vabs ( u -- v )
Factor documentation > Factor handbook > The language > Numbers > Vector operations > Vector arithmetic
Prev:vneg ( u -- v )
Next:vsqrt ( u -- v )


Vocabulary
math.vectors

Inputs and outputs
ua sequence of numbers
va sequence of non-negative real numbers


Word description
Takes the absolute value of each element of u.

Definition
IN: math.vectors

GENERIC: vabs ( u -- v )


Methods
USING: math.vectors sequences.cords ;

M: cord vabs [ vabs ] cord-map ; inline


USING: kernel math math.vectors sequences ;

M: object vabs [ abs ] map ; inline


USING: generic kernel math.vectors math.vectors.simd
math.vectors.simd.intrinsics math.vectors.simd.private ;

M: simd-128 vabs
dup simd-rep
[ (simd-vabs) ] [ M\ simd-128 vabs (call-next-method) ]
v->v-op ; inline