Datatype complexComplex numbers are the most important numbers in ChaosPro: The whole fractal calculation is done using complex numbers, so one of the main reasons of writing the compiler was to natively support such a datatype. Complex numbers consist of two floating point numbers, the one being called "real part",
the other one being called "imaginary part".
Writing down a complex number is done either by surrounding the two floating point numbers by
parenthesis or by using the "imaginary 1", called "i". a = (1.2,-1.3); // surrounded by brackets, separated by comma a = (1.2/-1.3); // surrounded by brackets, separated by / a = 1.2+1.3i; // using the imaginary "1", i.e. "i". Note that "i"=(0,1) a = 1.2+i*1.3; // using "i" in front of the imaginary part
Complex numbers are stored internally as two floating point numbers which use the 80 bit FPU format
(internal coprocessor format), with 14 bit exponent and 64 bit mantissa. So each component of a
complex number has the same precision as a real number. Complex numbers are converted automatically to other datatypes if necessary and allowed. Converting to:
Converting from:
|