Bug 2547 - Incorrect return from float nearbyint (0X1.3041C6P+21)
Summary: Incorrect return from float nearbyint (0X1.3041C6P+21)
Status: RESOLVED FIXED
Alias: None
Product: glibc
Classification: Unclassified
Component: math (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Andreas Jaeger
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-04-12 22:17 IST by H.J. Lu
Modified: 2012-02-22 13:10 IST (History)
2 users (show)

See Also:
Host: x86_64-unknown-linux-gnu
Target: x86_64-unknown-linux-gnu
Build: x86_64-unknown-linux-gnu
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description H.J. Lu 2006-04-12 22:17:37 IST
Failure: Test: nearbyint (0X1.3041C6P+21) == 0X1.3041C8P+21
Result:
 is:          2.49247200000000000000e+06   0x1.3041c000000000000000p+21
 should be:   2.49247300000000000000e+06   0x1.3041c800000000000000p+21
 difference:  1.00000000000000000000e+00   0x1.00000000000000000000p+0
 ulp       :  4.0000
 max.ulp   :  0.0000
Comment 1 H.J. Lu 2006-04-13 17:07:01 IST
The problem is:

       The nearbyint() functions round their argument to an integer  value  in
       floating point format, using the current rounding direction and without
       raising the inexact exception.

But ieee754/flt-32/s_nearbyintf.c doesn't check the current rounding direction
at all.
Comment 2 Ulrich Drepper 2006-04-23 17:51:49 IST
Suspended until somebody comes up with a patch.
Comment 3 Joseph Myers 2012-02-22 13:10:26 IST
Fixed.

commit 6cbeae4719aeb3edb6143fe5dd6d2a5ab45c0248
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Wed Feb 22 13:03:40 2012 +0000

    Fix nearbyintf rounding.