mpz_limbs interface
Vincent Lefevre
vincent at vinc17.net
Thu Feb 6 11:38:50 UTC 2014
On 2014-02-06 11:54:04 +0100, Niels Möller wrote:
> Marc Glisse <marc.glisse at inria.fr> writes:
> >> + ASSERT (d != 0.5*d); /* Exclude infinities */
> >
> > That excludes more than infinities, it might also exclude
> > FLT_TRUE_MIN, no?
>
> I would have expected that FLT_TRUE_MIN * 0.5 == 0.0. And then it's not
> excluded by that assert. But I'm not familiar with those fine floating
> point details.
In rounding mode toward +inf (FE_UPWARD), FLT_TRUE_MIN * 0.5 gives
FLT_TRUE_MIN. You may need:
ASSERT (d - d == 0);
--
Vincent Lefèvre <vincent at vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
More information about the gmp-devel
mailing list