public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug math/6788] New: expm1() does not set errno on overflow
@ 2008-07-30 15:09 mtk dot manpages at gmail dot com
  2008-07-31  8:58 ` [Bug math/6788] " mtk dot manpages at gmail dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: mtk dot manpages at gmail dot com @ 2008-07-30 15:09 UTC (permalink / raw)
  To: glibc-bugs

On overflow, expm1() raises an overflow exception (e.g., expm1(1e4) on x86-32),
but does not set errno.  For this case, errno should be set to ERANGE.

Background: 
On error, many glibc math functions both set errno and raise an exception
(fetestexcept(3)).  For example, the following  function all do this: acos(),
asin(), cosh(), sinh(), acosh(), asinh(), exp(), exp2(), ldexp(), log(),
log10(), log2().  However, there is much inconsistency.  Some functions raise an
exception, but don't set errno.  Some functions set errno for some errors, but
not others.  A few set errno, but don't raise an exception.  This series of bug
reports documents deviations from what I consider the ideal: all functions
should BOTH set errno AND raise an exception for all errors.

All of these reports relate to tests on glibc 2.8 (as provided by SUSE 11.0).

-- 
           Summary: expm1() does not set errno on overflow
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: math
        AssignedTo: aj at suse dot de
        ReportedBy: mtk dot manpages at gmail dot com
                CC: glibc-bugs at sources dot redhat dot com


http://sourceware.org/bugzilla/show_bug.cgi?id=6788

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug math/6788] expm1() does not set errno on overflow
  2008-07-30 15:09 [Bug math/6788] New: expm1() does not set errno on overflow mtk dot manpages at gmail dot com
@ 2008-07-31  8:58 ` mtk dot manpages at gmail dot com
  2010-09-11 15:24 ` mtk dot manpages at gmail dot com
  2010-09-12  6:39 ` mtk dot manpages at gmail dot com
  2 siblings, 0 replies; 4+ messages in thread
From: mtk dot manpages at gmail dot com @ 2008-07-31  8:58 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From mtk dot manpages at gmail dot com  2008-07-31 08:57 -------
Created an attachment (id=2853)
 --> (http://sourceware.org/bugzilla/attachment.cgi?id=2853&action=view)
test program

Sample run demonstrating problem (note that raising FE_INVALID here is probably
also a bug):

$ /tmp/mt_expm1 1e5
errno == 0
fetestexcept() says:  FE_INVALID FE_OVERFLOW FE_INEXACT
expm1(1.00000000000000000e+05)=nan
0 FE_OVERFLOW nan


-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=6788

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug math/6788] expm1() does not set errno on overflow
  2008-07-30 15:09 [Bug math/6788] New: expm1() does not set errno on overflow mtk dot manpages at gmail dot com
  2008-07-31  8:58 ` [Bug math/6788] " mtk dot manpages at gmail dot com
@ 2010-09-11 15:24 ` mtk dot manpages at gmail dot com
  2010-09-12  6:39 ` mtk dot manpages at gmail dot com
  2 siblings, 0 replies; 4+ messages in thread
From: mtk dot manpages at gmail dot com @ 2010-09-11 15:24 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From mtk dot manpages at gmail dot com  2010-09-11 15:24 -------
This bug was fixed in glibc 2.10. The man page is updated for man-pages-2.37.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


http://sourceware.org/bugzilla/show_bug.cgi?id=6788

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug math/6788] expm1() does not set errno on overflow
  2008-07-30 15:09 [Bug math/6788] New: expm1() does not set errno on overflow mtk dot manpages at gmail dot com
  2008-07-31  8:58 ` [Bug math/6788] " mtk dot manpages at gmail dot com
  2010-09-11 15:24 ` mtk dot manpages at gmail dot com
@ 2010-09-12  6:39 ` mtk dot manpages at gmail dot com
  2 siblings, 0 replies; 4+ messages in thread
From: mtk dot manpages at gmail dot com @ 2010-09-12  6:39 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From mtk dot manpages at gmail dot com  2010-09-12 06:38 -------
Correcting my earl(In reply to comment #2)
> This bug was fixed in glibc 2.10. The man page is updated for man-pages-2.37.

Correction. It looks like the fix was in 2.11, or possibly 2.12. I have no test
system for 2.11, but 2.12 passes. From the source (sysdeps/i386/fpu/s_expm1.S)
it looks like the changes were in 2.11.

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=6788

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-09-12  6:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-30 15:09 [Bug math/6788] New: expm1() does not set errno on overflow mtk dot manpages at gmail dot com
2008-07-31  8:58 ` [Bug math/6788] " mtk dot manpages at gmail dot com
2010-09-11 15:24 ` mtk dot manpages at gmail dot com
2010-09-12  6:39 ` mtk dot manpages at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).