Boost logo

Boost :

From: Guillaume Melquiond (guillaume.melquiond_at_[hidden])
Date: 2008-01-14 13:33:53


Le lundi 14 janvier 2008 à 15:01 +0100, Guillaume Melquiond a écrit :
> Le jeudi 03 janvier 2008 à 17:47 +0000, John Maddock a écrit :
>
> > >> boost::interval<double> in(1u);
> > >> but creates a nonsense interval.
>
> > I've since found the issue to be specific to rounded_arith_opp: it negates
> > the value being converted even if it's an unsigned type. The attached patch
> > fixes this, and also suppresses some pesky MSVC warnings.
>
> I see, the behavior you experienced makes sense. I should check now why
> I did not experience it; there may be an optimization bug in GCC that
> hided it.

Replying to myself. I was too eager in accusing GCC: The mistake is
actually in the library for C99-enabled compilers. Now that I fixed it,
interval<double>(1u) returns [-4.29497e+09,1] on my computer. So rounded
conversions are now performed as they were expected (yet not intended)
to perform, but it also means that the bug will become visible with
other compilers than MSVC.

Best regards,

Guillaume


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