1 USING: help.markup help.syntax math math.private math.functions
5 ARTICLE: "complex-numbers-zero" "Embedding of real numbers in complex numbers"
6 "Constructing a complex number with an imaginary component equal to an integer zero simply returns the real number corresponding to the real component:"
7 { $example "C{ 1 2 } C{ 3 -2 } + ." "4" }
8 "Constructing a complex number with an imaginary component equal to floating point zero will still output a new complex number, however:"
9 { $example "C{ 0.0 2.0 } C{ 0.0 1.0 } * ." "C{ -2.0 0.0 }" }
10 "Unlike math, where all real numbers are also complex numbers, Factor only considers a number to be a complex number if its imaginary part is non-zero. However, complex number operations are fully supported for real numbers; they are treated as having an imaginary part of zero." ;
12 ARTICLE: "complex-numbers" "Complex numbers"
13 { $subsections complex }
14 "Complex numbers arise as solutions to quadratic equations whose graph does not intersect the " { $emphasis "x" } " axis. Their literal syntax is covered in " { $link "syntax-complex-numbers" } "."
16 "Complex numbers can be taken apart:"
22 "Complex numbers can be constructed from real numbers:"
25 "complex-numbers-zero"
27 { $see-also "syntax-complex-numbers" } ;
29 { $class-description "The class of complex numbers with non-zero imaginary part." } ;
31 ABOUT: "complex-numbers"