|
Ch is the only computing environment in existence
that can perform numerical computing with
consistent numerical results under the IEEE
floating-point arithmetic in the entire real domain
and complex domain using an extended complex plane
for a Riemman sphere. Two complex metanumbers
ComplexInf for complex infinity and ComplexNaN for
complex-not-a-number are introduced.
#include
#include
int main() {
double complex z;
z = 1/0.0;
printf("z = %f\n", z);
z = sqrt(ComplexInf);
printf("z = %f\n", z);
z = exp(ComplexInf);
printf("z = %f\n", z);
return 0;
}
The output is:
z = ComplexInf
z = ComplexInf
z = ComplexNaN
|