bug-gnulib
[Top][All Lists]
Advanced

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

floor, ceil, trunc, round, minus zero, and alpha


From: Bruno Haible
Subject: floor, ceil, trunc, round, minus zero, and alpha
Date: Mon, 20 Dec 2010 14:55:10 +0100
User-agent: KMail/1.9.9

Hi,

On 2010-11-04, Eric added tests checking the sign of the minus zero value
of floor, ceil, trunc, round.
<http://lists.gnu.org/archive/html/bug-gnulib/2010-11/msg00020.html>
<http://lists.gnu.org/archive/html/bug-gnulib/2010-11/msg00029.html>

These tests
  - fail on OSF/1 with DEC Alpha CPU,
  - are marked as [MX] in POSIX [1][2][3][4], that is, an optional feature
    not contained in ISO C 99,
  - make little sense for 'ceil' from a mathematical point of view:
    ceil is a monotonically increasing function but POSIX wants
    ceil(-0.5) = 0.0 and ceil(-0.0) = -0.0,
  - are probably rarely exploited in practice, because only the
    integer value of the result is interesting.

Most programs should not need these stricter [MX] requirements.
I'll therefore create new modules 'floorf-posix', 'floor-posix',
'floorl-posix', etc., and revert the 'floorf', 'floor', 'floorl' etc.
modules to the ISO C99 semantics.

Bruno

[1] http://pubs.opengroup.org/onlinepubs/9699919799/functions/floor.html
[2] http://pubs.opengroup.org/onlinepubs/9699919799/functions/ceil.html
[3] http://pubs.opengroup.org/onlinepubs/9699919799/functions/trunc.html
[4] http://pubs.opengroup.org/onlinepubs/9699919799/functions/round.html



reply via email to

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