[Top][All Lists]
[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
- floor, ceil, trunc, round, minus zero, and alpha,
Bruno Haible <=
- Re: floor, ceil, trunc, round, minus zero, and alpha, Eric Blake, 2010/12/20
- Re: floor, ceil, trunc, round, minus zero, and alpha, Bruno Haible, 2010/12/20
- Re: floor, ceil, trunc, round, minus zero, and alpha, Eric Blake, 2010/12/20
- Re: floor, ceil, trunc, round, minus zero, and alpha, Bruno Haible, 2010/12/20
- Re: floor, ceil, trunc, round, minus zero, and alpha, Paul Eggert, 2010/12/20
- Re: floor, ceil, trunc, round, minus zero, and alpha, Bruno Haible, 2010/12/20
- Re: floor, ceil, trunc, round, minus zero, and alpha, Bruno Haible, 2010/12/22
- Re: floor, ceil, trunc, round, minus zero, and alpha, Eric Blake, 2010/12/20
- Re: floor, ceil, trunc, round, minus zero, and alpha, Bruno Haible, 2010/12/22
- Prev by Date:
ttyname_r on HP-UX 11
- Next by Date:
Re: floor, ceil, trunc, round, minus zero, and alpha
- Previous by thread:
ttyname_r on HP-UX 11
- Next by thread:
Re: floor, ceil, trunc, round, minus zero, and alpha
- Index(es):