bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: new module 'floorl'


From: Paolo Bonzini
Subject: Re: new module 'floorl'
Date: Fri, 05 Oct 2007 07:09:55 +0200
User-agent: Thunderbird 2.0.0.6 (Macintosh/20070728)

Bruno Haible wrote:
Here's the module for the floorl() function. Very much like the truncl()
function.

Paolo, this replaces the floorl part of the 'mathl' module. I think the
following changes are all improvements:
  - Don't assume that LDBL_EPSILON is a power of two. If LDBL_EPSILON
    is not a power of two, I think the rounding will be incorrect for
    some numbers between 0.5/LDBL_EPSILON and 1.0/LDBL_EPSILON.
  - Forbid compiler optimizations: Compilers are allowed to rearrange
      y = 1.0L / LDBL_EPSILON + x - 1.0 / LDBL_EPSILON;
    into
      y = x,
    which would obviously break the function.
  - In math.h, do a "#define floorl rpl_floorl", in order to avoid
    possible undesired compiler optimizations.

No problem, but I wonder what's the rationale for the last item.

Paolo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]