Bug 3406

Summary: expf(x) gives infinity where correctly rounded result is finite
Product: glibc Reporter: Myles Sussman <myles>
Component: mathAssignee: Andreas Jaeger <aj>
Status: RESOLVED FIXED    
Severity: minor CC: glibc-bugs
Priority: P2 Flags: fweimer: security-
Version: 2.3.4   
Target Milestone: ---   
Host: 2.6.9-34.ELsmp Target:
Build: Last reconfirmed:
Attachments: sample program that reproduces the problem

Description Myles Sussman 2006-10-22 00:22:33 UTC
glibc-2.3.4-2.19
gcc version 3.4.5 20051201 (Red Hat 3.4.5-2)

The attached sample program takes expf(x) and float(exp(x)) for a number x 
such that the exponential is ALMOST +INF in 32-bit floating point. expf(x) 
returns (incorrectly) INF, where float(exp(x)) is finite.
Comment 1 Myles Sussman 2006-10-22 00:26:36 UTC
Created attachment 1383 [details]
sample program that reproduces the problem

Program output:


 x is 88.7220001220703125
  expf(x) is inf
  exp(x)  is 339996993417815084460509669606173966336
Comment 2 Joseph Myers 2008-02-11 20:52:12 UTC
Patch submitted: http://sourceware.org/ml/libc-alpha/2008-02/msg00011.html
Comment 3 Ulrich Drepper 2008-05-11 17:49:52 UTC
Fixed in cvs.