Out of the China Blue <> writes:
> In article <5cd72d26-ce0b-4503-b5f6->,
> steve <> wrote:
>
>> Given
>>
>> #include <stdio.h>
>> #include <complex.h>
>>
>> int
>> main (void)
>> {
>> complex z;
>> z = 1000. + I * 0;
>> z = cexp(z);
>> printf("%lf %lf\n", creal(z), cimag(z));
>> return (0);
>> }
>
> In general, exp(x+yi) = exp(x)(cos y + i sin y)
>
> exp (1000+0i) = exp(1000)(cos 0 + i sin 0) = exp(1000) (1+0i) = exp(1000)
>
>
> I think exp(1000) is out of range for IEEE reals.
In addition, "complex z;" is the wrong syntax; it should be
"double complex z;". The use of "complex" to mean "double complex"
is a gcc extension. (It's also an incorrect example in the original
C99 standard, which may be why gcc implemented it that way.)
--
Keith Thompson (The_Other_Keith)
kst- <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"