Boost logo

Boost :

Subject: Re: [boost] [multiprecision] General/design query about which conversions should be implicit/explicit
From: John Maddock (boost.regex_at_[hidden])
Date: 2014-05-31 12:33:03


> Does the floating point to rational multiprecision-types really don't
> loss information, i.e. does the following hold?
>
> double d1 = 0.1;
> rational_mp r1 = d1;
> double d2 = double(r1);
> rational_mp r2 = d2;
> assert(r1==r2);

It does hold yes.

John.


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