math.vectors: fix some $examples in docs.
parent
f6c0bfdb89
commit
de74b98278
|
@ -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 }"
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue