Bug 51171 - printf prints denormalized float incorrectly with -mieee
Summary: printf prints denormalized float incorrectly with -mieee
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: glibc
Version: 7.1
Hardware: alpha
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Aaron Brown
URL: ftp://ftp.cita.utoronto.ca/pub/vanhoo...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-08-08 00:44 UTC by Peter van Hoof
Modified: 2016-11-24 14:55 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2002-04-01 16:24:33 UTC
Embargoed:


Attachments (Terms of Use)
sample program that illustrates the bug (263 bytes, text/plain)
2001-08-08 00:45 UTC, Peter van Hoof
no flags Details

Description Peter van Hoof 2001-08-08 00:44:40 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.76 [en] (X11; U; SunOS 5.8 sun4m)

Description of problem:
when programs are compiled with -mieee, denormalized single
precision floating point numbers are printed incorrectly

How reproducible:
Always

Steps to Reproduce:
1. gcc -mieee bug5.c -lm
2. a.out

	

Actual Results:  result 1a: 1.175494e-38 -8.733655e+01
result 1b: 1.349571e-308
result 1c: 1.425942e-38


Expected Results:  result 1a: 1.175494e-38 -8.733655e+01
result 1b: 7.129711e-39
result 1c: 1.425942e-38


Additional info:

Expected results were run on a sparc 20 where denormalized
numbers are treated correctly.

Result 1b in the actual results is clearly wrong. However,
result 1c (which is the number printed in result 1b multiplied
with 2) is clearly correct. This suggests that the denormalized
numbers themselves are treated correctly, but that printf
prints them out incorrectly.

All variables in this program are single precision numbers, an
exponent of e-308 is clearly out of range, even for a
denormalized number.

Sample code is available at the URL listed above, and will
also be attached.

Comment 1 Peter van Hoof 2001-08-08 00:45:58 UTC
Created attachment 26754 [details]
sample program that illustrates the bug

Comment 2 George France 2002-04-01 16:24:29 UTC
Its a kernel problem.  I submitted a patch against the 2.4.18 kernel a few days
ago:

http://marc.theaimsgroup.com/?l=linux-kernel&m=101656561600848&w=2

You should be able to back port the patch without any problems.

--George

Comment 3 Phil Copeland 2002-04-02 00:22:46 UTC
As this is now in upstream code and in the upcoming shippable kernel... closing.


Note You need to log in before you can comment on or make changes to this bug.