Bug 10089

Summary: rintf() in sysdeps/ieee754/flt-32/s_rintf.c makes wrong rounding of 2097152.75
Product: glibc Reporter: Roman Kononov <kononov>
Component: mathAssignee: Andreas Jaeger <aj>
Status: RESOLVED DUPLICATE    
Severity: minor CC: glibc-bugs
Priority: P2 Flags: fweimer: security-
Version: unspecified   
Target Milestone: ---   
Host: x86_64-unknown-linux-gnu Target: x86_64-unknown-linux-gnu
Build: x86_64-unknown-linux-gnu Last reconfirmed:

Description Roman Kononov 2009-04-21 20:42:41 UTC
rintf(2097152.75) returns 2097152, which is wrong. It should be 2097153.

2097152.75 = 0x1.000006p+21 = 0b1000000000000000000000.11, which after rounding
should be 0b1000000000000000000001, which is 0x1.000008p+21 = 2097153

The behavior is shown by the __rintf function "ripped" from the glibc-20090420
snapshot.
Comment 1 Joseph Myers 2012-02-19 23:29:37 UTC
This is exactly the same testcase as in bug 2548.

*** This bug has been marked as a duplicate of bug 2548 ***