Bug 828980 - glibc libm regression: 0^-inf is -inf instead of +inf
Summary: glibc libm regression: 0^-inf is -inf instead of +inf
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: glibc
Version: rawhide
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Jeff Law
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-06-05 17:14 UTC by Michel Lind
Modified: 2016-11-24 16:13 UTC (History)
6 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2012-06-14 18:54:29 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Test case reproducing the regression (216 bytes, application/octet-stream)
2012-06-05 17:14 UTC, Michel Lind
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Sourceware 14241 0 None None None Never

Description Michel Lind 2012-06-05 17:14:05 UTC
Created attachment 589588 [details]
Test case reproducing the regression

Description of problem:
ISO/IEC 9899:TC3, Annex F.9.4.4 specifies that pow(0, -INFINITY) is inf, as it is in F-17's glibc-2.15-37.fc17.x86_64; however, in Rawhide's glibc, the same calculation returns -inf -- as tested by compiling the attached test case (either on F-17 or Rawhide) and running it with one glibc or the other.

Version-Release number of selected component (if applicable):
glibc-2.15.90-6.fc18.x86_64

How reproducible:
Always

Steps to Reproduce:
1. glibc -lm -o powtest powtest.c
  
Actual results:
pow(0.0, -INFINITY) = -inf (positive? 0)

Expected results:
pow(0.0, -INFINITY) = inf (positive? 1)

Additional info:
Noticed during a rebuild of Pure; test case provided by Pure author:
http://code.google.com/p/pure-lang/issues/detail?id=72

Comment 1 Michel Lind 2012-06-05 17:14:54 UTC
(In reply to comment #0)
> Steps to Reproduce:
> 1. glibc -lm -o powtest powtest.c
>
That should be gcc -lm -o powtest powtest.c, of course.

Comment 2 Jeff Law 2012-06-14 18:48:40 UTC
This is due to this upstream patch:

commit 2460d3aa21f04cdf28497683bd3e29183189f779
Author: Joseph Myers <joseph>
Date:   Wed Mar 21 12:14:57 2012 +0000

    Fix pow of zero and infinity to large powers.

Comment 3 Jeff Law 2012-06-14 18:54:29 UTC
I'm going to let Joseph handle it upstream.  We'll pick up the fix via our normal merging processes.

Comment 4 Jeff Law 2012-06-15 15:24:31 UTC
BTW, Joseph checked in a fix upstream and I've resyncd Rawhide with the upstream sources.

Comment 5 Michel Lind 2012-06-16 04:34:56 UTC
Could you update the bug tracker once there's a build on Koji I can test? The latest build is from June 13th and predates this fix. Thanks!

Comment 6 Jeff Law 2012-06-18 17:35:35 UTC
Just spun a fawhide build this morning which should contain this fix.

Comment 7 Michel Lind 2012-06-19 11:22:51 UTC
Confirmed that the failing test case in pure that originally revealed this bug now passes.


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