Factor Documentation
|
Home
|
Glossary
|
Search
factorcode.org
rect> ( x y -- z )
Factor documentation
>
Factor handbook
>
The language
>
Numbers
>
Complex numbers
Prev:
>rect ( z -- x y )
Next:
Embedding of real numbers in complex numbers
Vocabulary
math.functions
Inputs and outputs
x
a
real
y
a
real
z
a
number
Word description
Creates a complex number from real and imaginary components. If
z
is an integer zero, this will simply output
x
.
Definition
USING:
kernel
math
;
IN:
math.functions
:
rect>
( x y -- z )
dup
0
=
[
drop
]
[
complex
boa
]
if
;
inline