This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Problems exp'ing complex numbers


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]