Red Hat Bugzilla – Bug 828980
glibc libm regression: 0^-inf is -inf instead of +inf
Last modified: 2016-11-24 11:13:13 EST
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):
Steps to Reproduce:
1. glibc -lm -o powtest powtest.c
pow(0.0, -INFINITY) = -inf (positive? 0)
pow(0.0, -INFINITY) = inf (positive? 1)
Noticed during a rebuild of Pure; test case provided by Pure author:
(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.
This is due to this upstream patch:
Author: Joseph Myers <firstname.lastname@example.org>
Date: Wed Mar 21 12:14:57 2012 +0000
Fix pow of zero and infinity to large powers.
I'm going to let Joseph handle it upstream. We'll pick up the fix via our normal merging processes.
BTW, Joseph checked in a fix upstream and I've resyncd Rawhide with the upstream sources.
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!
Just spun a fawhide build this morning which should contain this fix.
Confirmed that the failing test case in pure that originally revealed this bug now passes.