From: Peder Holt (peder.holt_at_[hidden])
Date: 2005-10-31 13:42:18
On 10/31/05, Cromwell Enage <sponage_at_[hidden]> wrote:
> I've now added a BOOST_MPL_CFC_NO_MATH_DOUBLE macro
> that is defined in
> <boost/mpl/aux_/config/math_double.hpp> when it is
> known that BOOST_MPL_MATH_DOUBLE won't compile.
> Please send me your compiler-platform configuration if
> BOOST_MPL_MATH_DOUBLE doesn't work for you.
> Peder, The double_::aux::get_value function still
> returns a number 2^16 times too big on MSVC 7.1 when
> the input is a whole number.
I do not observe this on my VC7.1 compiler. What I see, is another effect:
Using setprecision(40) causes some overflow in the iostream formatting
of double, so that
800.0 is outputted as 8000000. This error is only present for whole numbers.
Reducing setprecision to 36 eliminates the problem, and for every
extra digit of precision you specify, you get another 0 appended.
Also, BOOST_MPL_MATH_DOUBLE is very unstable on VC7.1, For whole
numbers between 10 and 100 it ICE's (Not so for negative whole numbers
between -100 and -10)
Adding a . at the end of the number, prevents the ICE.
typedef BOOST_MPL_MATH_DOUBLE(56) type; <-ICE
typedef BOOST_MPL_MATH_DOUBLE(56.) type; <-OK
I also found a continued fraction representation for tangent that
converges much faster (and better) than any of the series
representation I have found:
Here is an implementation of this series. It is much faster on the
tangent.cpp test file, and doesn't give warnings for double_....
Works in the range -pi/2,pi/2
(Remove the double/tangent.hpp overload first :)
template <typename NumericTag>
* Continued fraction representation
, typename I
, typename FractionCount
typedef typename eval_if<
typedef typename minus<
, typename SeriesCount
#if !defined BOOST_MPL_CFG_NO_NESTED_FORWARDING
* Metafunction class return type.
typedef typename divides<
#endif /* BOOST_MPL_CFG_NO_NESTED_FORWARDING */
> Cromwell D. Enage
> Yahoo! Mail - PC Magazine Editors' Choice 2005
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk