Bug 51171 - printf prints denormalized float incorrectly with -mieee
printf prints denormalized float incorrectly with -mieee
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: glibc (Show other bugs)
7.1
alpha Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Aaron Brown
ftp://ftp.cita.utoronto.ca/pub/vanhoo...
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-08-07 20:44 EDT by Peter van Hoof
Modified: 2007-04-18 12:35 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-04-01 11:24:33 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


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

  None (edit)
Description Peter van Hoof 2001-08-07 20:44:40 EDT
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-07 20:45:58 EDT
Created attachment 26754 [details]
sample program that illustrates the bug
Comment 2 George France 2002-04-01 11:24:29 EST
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-01 19:22:46 EST
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.