Boost logo

Boost :

From: Cromwell Enage (sponage_at_[hidden])
Date: 2005-12-21 16:49:34


--- Chris Weed wrote:
> Hi,
> I am trying to simply print a compile-time double
> using gcc 4.0.0 on Sun.
> The following prints out : 1.9036e+185
>
> #include <boost/metamath/double.hpp>
> #include <boost/metamath/double_macros.hpp>
> #include <iostream>
>
> int main()
> {
> typedef BOOST_DOUBLE(3.3) D;
> D d;
> std::cout << (double)d << std::endl;
> return 0;
> }
>
> Am I doing something wrong?
> Chris

The most up-to-date version of MPL.Math is now at the
Boost vault <http://boost-consulting.com/vault/>. The
program should look like:

#include <boost/mpl/math/double.hpp>

int main()
{
    typedef BOOST_MPL_MATH_DOUBLE(3.3) D;
    D d;
    std::cout << d << std::endl;
    return 0;
}

You don't need the cast because the implicit
conversion already returns a double.

If you still encounter problems, let me know.

                              Cromwell D. Enage

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk