This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug math/19088] New: lround, llround missing exceptions close to overflow threshold


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]