
20 Feb
2007
20 Feb
'07
6:56 p.m.
Hi, I am getting the wrong result for the exponential of complex numbers such as the following: #include <boost/mpl/math/double.hpp> #include <boost/mpl/math/complex_number.hpp> #include <iostream> int main() { typedef boost::mpl::math::string_c_to_double<'-',2,'.',0>::type minus_two; typedef boost::mpl::times<minus_two,boost::mpl::math::pi<boost::mpl::math::double_tag>
::type minus_two_pi; typedef boost::mpl::math::complex_number<double_zero,minus_two_pi> imag_minus_two_pi; std::cout << imag_minus_two_pi() << std::endl;
std::cout << boost::mpl::math::exponential<imag_minus_two_pi>::type() << std::endl; return 0; } This prints: 0-6.28319i 1.0329-0.0109834i which should be 0-6.28319i 1.0000-0.00000i Chris