This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug math/5680] New: math functions (atanh, log, log1p) are inconsistent in treatment of errno
- From: "dickinsm at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: 26 Jan 2008 02:45:50 -0000
- Subject: [Bug math/5680] New: math functions (atanh, log, log1p) are inconsistent in treatment of errno
- Reply-to: sourceware-bugzilla at sourceware dot org
In version 2.5 of glibc, on SuSE Linux 10.2, it appears that the libm functions atanh, log and log1p (and
possibly others) are inconsistent in their handling of singularities:
log(0.0) returns -Infinity and sets errno = ERANGE
log1p(-1.0) returns -Infinity and doesn't set errno
atanh(-1.0) returns -Infinity and sets errno = EDOM.
According to the C99 standard (appendix F), and IEEE-754r, all of these operations should behave in
the same way---they should all return -Infinity and raise the "divide-by-zero" exception. This makes
sense mathematically: all three function calls correspond to singularities of log type. Admittedly, the
C99 standard has little to say about errno, but I don't understand why these three calls behave
differently with respect to setting of errno.
--
Summary: math functions (atanh, log, log1p) are inconsistent in
treatment of errno
Product: glibc
Version: unspecified
Status: NEW
Severity: normal
Priority: P2
Component: math
AssignedTo: aj at suse dot de
ReportedBy: dickinsm at gmail dot com
CC: glibc-bugs at sources dot redhat dot com
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://sourceware.org/bugzilla/show_bug.cgi?id=5680
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.