Factor Documentation
|
Home
|
Glossary
|
Search
factorcode.org
absq ( x -- y )
Factor documentation
>
Factor handbook
>
The language
>
Numbers
>
Mathematical functions
>
Powers and logarithms
Prev:
abs ( x -- y )
Next:
arg ( z -- arg )
Vocabulary
math.functions
Inputs and outputs
x
a
number
y
a non-negative real number
Word description
Computes the squared absolute value of a complex number. This is marginally more efficient than
abs
.
Definition
IN:
math.functions
GENERIC:
absq
( x -- y )
foldable
flushable
Methods
USING:
kernel
math
math.functions
;
M:
complex
absq
>rect
[
sq
]
bi@
+
;
inline
USING:
math
math.functions
;
M:
real
absq
sq
;
inline