This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug math/19088] New: lround, llround missing exceptions close to overflow threshold
- From: "jsm28 at gcc dot gnu.org" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Wed, 07 Oct 2015 21:25:46 +0000
- Subject: [Bug math/19088] New: lround, llround missing exceptions close to overflow threshold
- Auto-submitted: auto-generated
https://sourceware.org/bugzilla/show_bug.cgi?id=19088
Bug ID: 19088
Summary: lround, llround missing exceptions close to overflow
threshold
Product: glibc
Version: 2.22
Status: NEW
Severity: normal
Priority: P2
Component: math
Assignee: unassigned at sourceware dot org
Reporter: jsm28 at gcc dot gnu.org
Target Milestone: ---
The dbl-64, ldbl-96 and ldbl-128 implementations of lround and llround fail to
produce "invalid" exceptions in cases where the rounded result overflows the
target type, but truncating the floating-point argument to the next integer
towards zero does not overflow it (so in particular casts do not produce such
exceptions). (This issue cannot arise for float, or for double with 64-bit
target type, or for ldbl-96 with 64-bit target type and negative arguments,
because of insufficient precision in the floating-point type for arguments with
the relevant property to exist.)
For example, for long double on i386:
Failure: lround (0x7fffffff.8p0): Exception "Invalid operation" not set
Failure: lround (0x7fffffff.cp0): Exception "Invalid operation" not set
Failure: lround (-0x80000000.8p0): Exception "Invalid operation" not set
Failure: lround (-0x80000000.8p0): Exception "Inexact" set
Failure: lround (-0x80000000.cp0): Exception "Invalid operation" not set
Failure: lround (-0x80000000.cp0): Exception "Inexact" set
Failure: lround_downward (0x7fffffff.8p0): Exception "Invalid operation" not
set
Failure: lround_downward (0x7fffffff.cp0): Exception "Invalid operation" not
set
Failure: lround_downward (-0x80000000.8p0): Exception "Invalid operation" not
set
Failure: lround_downward (-0x80000000.8p0): Exception "Inexact" set
Failure: lround_downward (-0x80000000.cp0): Exception "Invalid operation" not
set
Failure: lround_downward (-0x80000000.cp0): Exception "Inexact" set
Failure: lround_towardzero (0x7fffffff.8p0): Exception "Invalid operation" not
set
Failure: lround_towardzero (0x7fffffff.cp0): Exception "Invalid operation" not
set
Failure: lround_towardzero (-0x80000000.8p0): Exception "Invalid operation" not
set
Failure: lround_towardzero (-0x80000000.8p0): Exception "Inexact" set
Failure: lround_towardzero (-0x80000000.cp0): Exception "Invalid operation" not
set
Failure: lround_towardzero (-0x80000000.cp0): Exception "Inexact" set
Failure: lround_upward (0x7fffffff.8p0): Exception "Invalid operation" not set
Failure: lround_upward (0x7fffffff.cp0): Exception "Invalid operation" not set
Failure: lround_upward (-0x80000000.8p0): Exception "Invalid operation" not set
Failure: lround_upward (-0x80000000.8p0): Exception "Inexact" set
Failure: lround_upward (-0x80000000.cp0): Exception "Invalid operation" not set
Failure: lround_upward (-0x80000000.cp0): Exception "Inexact" set
Failure: llround (0x7fffffffffffffff.8p0): Exception "Invalid operation" not
set
Failure: llround_downward (0x7fffffffffffffff.8p0): Exception "Invalid
operation" not set
Failure: llround_towardzero (0x7fffffffffffffff.8p0): Exception "Invalid
operation" not set
Failure: llround_upward (0x7fffffffffffffff.8p0): Exception "Invalid operation"
not set
--
You are receiving this mail because:
You are on the CC list for the bug.