vs+ ( u v -- w )
Factor handbook » The language » Numbers » Vector operations » Vector arithmetic

Prev:n^v ( n v -- w )
Next:vs- ( u v -- w )


Vocabulary
math.vectors

Inputs
ua sequence of numbers
va sequence of numbers


Outputs
wa sequence of numbers


Word description
Adds u and v component-wise with saturation.

Examples
With saturation:
USING: alien.c-types math.vectors prettyprint specialized-arrays ; SPECIALIZED-ARRAY: uchar uchar-array{ 100 200 150 } uchar-array{ 70 70 70 } vs+ .
uchar-array{ 170 255 220 }

Without saturation:
USING: alien.c-types math.vectors prettyprint specialized-arrays ; SPECIALIZED-ARRAY: uchar uchar-array{ 100 200 150 } uchar-array{ 70 70 70 } v+ .
uchar-array{ 170 14 220 }


See also
vs-, vs*

Definition


Methods