This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Problems exp'ing complex numbers
- To: libstdc++ at gcc dot gnu dot org
- Subject: Problems exp'ing complex numbers
- From: Wolfgang Mauerer <wolfgang at mynetix dot de>
- Date: Sat, 30 Dec 2000 19:54:52 +0100
Hello,
I experienced a problem related to the libstdc++ complex<>-Class and
don't know wether it's my false understanding of the problem, a bug
in libstdc++ or a feature that's intentionaly missing from the
library. When I use the program code
<snap>
long_double_complex test (some, value)
cout << exp(test) << endl;
</snap>
I get (inf, nan) as result when huge numbers are used.
The error doesn't appear any more if the following template
specialisation is used:
complex<long double> exp(const complex<long double> x) {
return polar(expl(real(x)), imag(x));
}
I would appreciate if someone of you could give me a hint
wether my code is erroneous or this is a feature that's missing
from libstdc++ and shouldn't do so.
Thanks,
Wolfgang
P.S.: Please CC to my eMail address since I'm not on that list.