Message108543
| Author |
mark.dickinson |
| Recipients |
drkirkby, mark.dickinson |
| Date |
2010年06月24日.19:02:56 |
| SpamBayes Score |
0.004369052 |
| Marked as misclassified |
No |
| Message-id |
<1277406177.8.0.434855118637.issue9069@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Thanks for the details. So the relevant code (see the float_hex function in Objects/floatobject.c) looks like this:
if (x == 0.0) {
if(copysign(1.0, x) == -1.0)
return PyString_FromString("-0x0.0p+0");
else
return PyString_FromString("0x0.0p+0");
}
This *should* produce the correct string for -0.0 (because -0.0 compares equal to 0.0, and then copysign(1.0, x) should be -1.0); I'm reasonably confident that the C code is correct, since the tests pass on all the other platforms that get tested regularly.
So a buggy system copysign function looks like a possibility. Another more likely possibility occurs to me, though: and that's that there's a buggy compiler optimization going on: the compiler sees that we're in an 'x == 0.0' branch, and decides that it can substitute '0.0' for 'x' everywhere in the 'if' block. But this is just guessing.
Do you still get these failures in a debug build of Python (i.e., by passing --with-pydebug to the configure script)? |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2010年06月24日 19:02:57 | mark.dickinson | set | recipients:
+ mark.dickinson, drkirkby |
| 2010年06月24日 19:02:57 | mark.dickinson | set | messageid: <1277406177.8.0.434855118637.issue9069@psf.upfronthosting.co.za> |
| 2010年06月24日 19:02:56 | mark.dickinson | link | issue9069 messages |
| 2010年06月24日 19:02:56 | mark.dickinson | create |
|