From de74b98278bbe2e94af1d6dff687317539cfaa2f Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Thu, 29 Dec 2011 17:31:55 -0800 Subject: [PATCH] math.vectors: fix some $examples in docs. --- basis/math/vectors/vectors-docs.factor | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/basis/math/vectors/vectors-docs.factor b/basis/math/vectors/vectors-docs.factor index 19a30bde74..b037d42786 100644 --- a/basis/math/vectors/vectors-docs.factor +++ b/basis/math/vectors/vectors-docs.factor @@ -124,10 +124,9 @@ ARTICLE: "math-vectors-misc" "Miscellaneous vector functions" ARTICLE: "math-vectors-simd-logic" "Componentwise logic with SIMD vectors" "Processor SIMD units supported by the " { $vocab-link "math.vectors.simd" } " vocabulary represent boolean values as bitmasks, where a true result's binary representation is all ones and a false representation is all zeroes. This is the format in which results from comparison words such as " { $link v= } " return their results and in which logic and test words such as " { $link vand } " and " { $link vall? } " take their inputs when working with SIMD types. For a float vector, false will manifest itself as " { $snippet "0.0" } " and true as a " { $link POSTPONE: NAN: } " literal with a string of on bits in its payload:" { $example -"""USING: math.vectors math.vectors.simd prettyprint ; - -float-4{ 1.0 2.0 3.0 0/0. } float-4{ 1.0 -2.0 3.0 0/0. } v= .""" -"""float-4{ NAN: fffffe0000000 0.0 NAN: fffffe0000000 0.0 }""" + "USING: math.vectors math.vectors.simd prettyprint ;" + "float-4{ 1.0 2.0 3.0 0/0. } float-4{ 1.0 -2.0 3.0 0/0. } v= ." + "float-4{ NAN: fffffe0000000 0.0 NAN: fffffe0000000 0.0 }" } "For an integer vector, false will manifest as " { $snippet "0" } " and true as " { $snippet "-1" } " (for signed vectors) or the largest representable value of the element type (for unsigned vectors):" { $example @@ -407,7 +406,7 @@ HELP: vbroadcast { $description "Outputs a new SIMD array of the same type as " { $snippet "u" } " where every element is equal to the " { $snippet "n" } "th element of " { $snippet "u" } "." } { $examples { $example - "USING: alien.c-types math.vectors math.vectors.simd" "prettyprint ;" + "USING: alien.c-types math.vectors math.vectors.simd prettyprint ;" "int-4{ 69 42 911 13 } 2 vbroadcast ." "int-4{ 911 911 911 911 }" } @@ -422,7 +421,7 @@ HELP: vshuffle } } { $examples { $example - "USING: alien.c-types math.vectors math.vectors.simd" "prettyprint ;" + "USING: alien.c-types math.vectors math.vectors.simd prettyprint ;" "int-4{ 69 42 911 13 } { 1 3 2 3 } vshuffle ." "int-4{ 42 13 911 13 }" }