public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug math/6804] scalb() does not set errno on domain error
[not found] <bug-6804-131@http.sourceware.org/bugzilla/>
@ 2012-03-01 17:37 ` jsm28 at gcc dot gnu.org
2014-03-31 14:58 ` cvs-commit at gcc dot gnu.org
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2012-03-01 17:37 UTC (permalink / raw)
To: glibc-bugs
http://sourceware.org/bugzilla/show_bug.cgi?id=6804
Joseph Myers <jsm28 at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|aj at suse dot de |unassigned at sourceware
| |dot org
--- Comment #2 from Joseph Myers <jsm28 at gcc dot gnu.org> 2012-03-01 17:36:29 UTC ---
Confirmed with current sources on x86 and x86_64.
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug math/6804] scalb() does not set errno on domain error
[not found] <bug-6804-131@http.sourceware.org/bugzilla/>
2012-03-01 17:37 ` [Bug math/6804] scalb() does not set errno on domain error jsm28 at gcc dot gnu.org
@ 2014-03-31 14:58 ` cvs-commit at gcc dot gnu.org
2014-03-31 14:59 ` jsm28 at gcc dot gnu.org
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2014-03-31 14:58 UTC (permalink / raw)
To: glibc-bugs
https://sourceware.org/bugzilla/show_bug.cgi?id=6804
--- Comment #3 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, master has been updated
via 8795b4a443a8f19d279e0c1bc99b73d1f5aec166 (commit)
from 54fa2475d37b9c7afd903eb970362e50ec76f01e (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=8795b4a443a8f19d279e0c1bc99b73d1f5aec166
commit 8795b4a443a8f19d279e0c1bc99b73d1f5aec166
Author: Joseph Myers <joseph@codesourcery.com>
Date: Mon Mar 31 14:57:53 2014 +0000
Set errno for scalb errors (bug 6803, bug 6804).
This patch fixes the default mode of scalb to set errno (bugs 6803 and
6804).
Previously, the _LIB_VERSION == _SVID_ mode would set errno but only
in some relevant cases, and with various peculiarities (such as errno
setting when an exact infinity or zero result arises with an argument
to scalb being an infinity). This patch leaves this mode
bug-compatible, while making the default mode set errno in accordance
with normal practice (so an exact infinity from an infinite argument
is not an error, and nor is an exact zero result). gen-libm-test.pl
is taught new notation such as ERRNO_PLUS_OFLOW to facilitate writing
the tests of errno setting for underflow / overflow in libm-test.inc.
Note that bug 6803 also covers scalbn and scalbln, but this patch only
addresses the scalb parts of that bug (along with the whole of bug
6804).
Tested x86_64 and x86.
[BZ #6803]
[BZ #6804]
* math/w_scalb.c (__scalb): For non-SVID mode, check result and
set errno as appropriate.
* math/w_scalbf.c (__scalbf): Likewise.
* math/w_scalbl.c (__scalbl): Likewise.
* math/gen-libm-test.pl (parse_args): Handle ERRNO_PLUS_OFLOW,
ERRNO_MINUS_OFLOW, ERRNO_PLUS_UFLOW and ERRNO_MINUS_UFLOW.
* math/libm-test.inc (scalb_test_data): Add errno expectations.
Add more NaN tests.
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 11 ++++
NEWS | 10 ++--
math/gen-libm-test.pl | 10 ++++
math/libm-test.inc | 134 +++++++++++++++++++++++++------------------------
math/w_scalb.c | 30 ++++++++++-
math/w_scalbf.c | 30 ++++++++++-
math/w_scalbl.c | 30 ++++++++++-
7 files changed, 175 insertions(+), 80 deletions(-)
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug math/6804] scalb() does not set errno on domain error
[not found] <bug-6804-131@http.sourceware.org/bugzilla/>
2012-03-01 17:37 ` [Bug math/6804] scalb() does not set errno on domain error jsm28 at gcc dot gnu.org
2014-03-31 14:58 ` cvs-commit at gcc dot gnu.org
@ 2014-03-31 14:59 ` jsm28 at gcc dot gnu.org
2014-07-04 5:43 ` fweimer at redhat dot com
2020-05-23 10:44 ` mtk.manpages at gmail dot com
4 siblings, 0 replies; 6+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2014-03-31 14:59 UTC (permalink / raw)
To: glibc-bugs
https://sourceware.org/bugzilla/show_bug.cgi?id=6804
Joseph Myers <jsm28 at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
--- Comment #4 from Joseph Myers <jsm28 at gcc dot gnu.org> ---
Fixed for 2.20.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug math/6804] scalb() does not set errno on domain error
[not found] <bug-6804-131@http.sourceware.org/bugzilla/>
` (2 preceding siblings ...)
2014-03-31 14:59 ` jsm28 at gcc dot gnu.org
@ 2014-07-04 5:43 ` fweimer at redhat dot com
2020-05-23 10:44 ` mtk.manpages at gmail dot com
4 siblings, 0 replies; 6+ messages in thread
From: fweimer at redhat dot com @ 2014-07-04 5:43 UTC (permalink / raw)
To: glibc-bugs
https://sourceware.org/bugzilla/show_bug.cgi?id=6804
Florian Weimer <fweimer at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Flags| |review-
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug math/6804] scalb() does not set errno on domain error
[not found] <bug-6804-131@http.sourceware.org/bugzilla/>
` (3 preceding siblings ...)
2014-07-04 5:43 ` fweimer at redhat dot com
@ 2020-05-23 10:44 ` mtk.manpages at gmail dot com
4 siblings, 0 replies; 6+ messages in thread
From: mtk.manpages at gmail dot com @ 2020-05-23 10:44 UTC (permalink / raw)
To: glibc-bugs
https://sourceware.org/bugzilla/show_bug.cgi?id=6804
--- Comment #6 from Michael Kerrisk <mtk.manpages at gmail dot com> ---
Fix documented for man-pages-5.07
commit ab5c28f9423931435a1cf41a0b058459b2bce998 (HEAD -> master)
Author: Michael Kerrisk <mtk.manpages@gmail.com>
Date: Sat May 23 12:20:59 2020 +0200
scalb.3: These functions now correctly set errno for the EDOM and ERANGE
cas
es
Modify DESCRIPTION appropriately and add BUGS section.
The fix was in glibc 2.20.
See https://www.sourceware.org/bugzilla/show_bug.cgi?id=6803
and https://www.sourceware.org/bugzilla/show_bug.cgi?id=6804
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
diff --git a/man3/scalb.3 b/man3/scalb.3
index 2db0bd9ad..c685b68eb 100644
--- a/man3/scalb.3
+++ b/man3/scalb.3
@@ -150,34 +150,28 @@ The following errors can occur:
Domain error: \fIx\fP is 0, and \fIexp\fP is positive infinity, \
or \fIx\fP is positive infinity and \fIexp\fP is negative infinity \
and the other argument is not a NaN
-.\" .I errno
-.\" is set to
-.\" .BR EDOM .
+.I errno
+is set to
+.BR EDOM .
An invalid floating-point exception
.RB ( FE_INVALID )
is raised.
.TP
Range error, overflow
-.\" .I errno
-.\" is set to
-.\" .BR ERANGE .
+.I errno
+is set to
+.BR ERANGE .
An overflow floating-point exception
.RB ( FE_OVERFLOW )
is raised.
.TP
Range error, underflow
-.\" .I errno
-.\" is set to
-.\" .BR ERANGE .
+.I errno
+is set to
+.BR ERANGE .
An underflow floating-point exception
.RB ( FE_UNDERFLOW )
is raised.
-.PP
-These functions do not set
-.IR errno .
-.\" FIXME . Is it intentional that these functions do not set errno?
-.\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6803
-.\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6804
.SH ATTRIBUTES
For an explanation of the terms used in this section, see
.BR attributes (7).
@@ -215,6 +209,13 @@ are unstandardized;
is nevertheless present on several other systems
.\" Looking at header files: scalbf() is present on the
.\" BSDs, Tru64, HP-UX 11, Irix 6.5; scalbl() is on HP-UX 11 and Tru64.
+.SH BUGS
+Before glibc 2.20,
+.\" http://sources.redhat.com/bugzilla/show_bug.cgi?id=6803
+.\" http://sources.redhat.com/bugzilla/show_bug.cgi?id=6804
+these functions did not set
+.I errno
+for domain and range errors.
.SH SEE ALSO
.BR ldexp (3),
.BR scalbln (3)
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug math/6804] New: scalb() does not set errno on domain error
@ 2008-07-31 11:18 mtk dot manpages at gmail dot com
2008-07-31 11:19 ` [Bug math/6804] " mtk dot manpages at gmail dot com
0 siblings, 1 reply; 6+ messages in thread
From: mtk dot manpages at gmail dot com @ 2008-07-31 11:18 UTC (permalink / raw)
To: glibc-bugs
On a domain error(), scalb() correctly raises an exception. But errno is not
set. It should be set to EDOM for this error.
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: scalb() does not set errno on domain error
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=6804
------- 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] 6+ messages in thread
end of thread, other threads:[~2020-05-23 10:44 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <bug-6804-131@http.sourceware.org/bugzilla/>
2012-03-01 17:37 ` [Bug math/6804] scalb() does not set errno on domain error jsm28 at gcc dot gnu.org
2014-03-31 14:58 ` cvs-commit at gcc dot gnu.org
2014-03-31 14:59 ` jsm28 at gcc dot gnu.org
2014-07-04 5:43 ` fweimer at redhat dot com
2020-05-23 10:44 ` mtk.manpages at gmail dot com
2008-07-31 11:18 [Bug math/6804] New: " mtk dot manpages at gmail dot com
2008-07-31 11:19 ` [Bug math/6804] " 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).