Test_coercion failing on Panther for complex numbers

I need a little guidance with bug #775892. I think it's non-serious, but I'm not sure (and I don't know how easy it is to fix). Test_coercion is failing on the beta for MacOSX 10.3. All the failures have the same form: the output is (XXX-0j) in stead of the expected (XXX+0j).

[Jack Jansen]
I need a little guidance with bug #775892. I think it's non-serious, but I'm not sure (and I don't know how easy it is to fix).
Test_coercion is failing on the beta for MacOSX 10.3. All the failures have the same form: the output is (XXX-0j) in stead of the expected (XXX+0j).
It isn't serious, and we've (you & I) been thru this failure before <wink>. If the compiler for this box has some sort of switch named along the lines of "don't used fused multiply-add", it should cure it. Or we could rewrite the test not to rely on the (more accidental than not, given the state of C compilers) sign of 0.

On dinsdag, 22 juli 2003, at 23:28PM, Tim Peters wrote:
[Jack Jansen]
I need a little guidance with bug #775892. I think it's non-serious, but I'm not sure (and I don't know how easy it is to fix).
Test_coercion is failing on the beta for MacOSX 10.3. All the failures have the same form: the output is (XXX-0j) in stead of the expected (XXX+0j).
It isn't serious, and we've (you & I) been thru this failure before <wink>. If the compiler for this box has some sort of switch named along the lines of "don't used fused multiply-add", it should cure it.
Ah... Long ago in a universe far from here... I remember, I had the same problem on MacOS9 at some point. But the strange thing with the current incarnation of the problem is that the exact same binary (build on OSX 10.2) passes test_coercion on 10.2 but fails it on 10.3. Could the C library be involved?

[Jack Jansen]
Ah... Long ago in a universe far from here... I remember, I had the same problem on MacOS9 at some point.
And I believed it was a design error in the FPU's fused multiply-add implementation.
But the strange thing with the current incarnation of the problem is that the exact same binary (build on OSX 10.2) passes test_coercion on 10.2 but fails it on 10.3. Could the C library be involved?
Absolutely. This is how a string gets created from a complex: PyOS_snprintf(buf, bufsz, "(%.*g%+.*gj)", precision, v->cval.real, precision, v->cval.imag); IOW, the C library produces the "+" or "-" here, and C libraries are utterly inconsistent about whether they print -0.0 with a "+" or a "-" sign. I believe it's an FPU bug that -0.0 occurs in this test, but there are too many accidents to be worth the pain of fighting here, and the test should be rewritten not to produce these ambiguous (in practice although not in theory) cases to begin with (but after 2.3).

Jack Jansen <Jack.Jansen@cwi.nl> writes:
On dinsdag, 22 juli 2003, at 23:28PM, Tim Peters wrote:
[Jack Jansen]
I need a little guidance with bug #775892. I think it's non-serious, but I'm not sure (and I don't know how easy it is to fix).
Test_coercion is failing on the beta for MacOSX 10.3. All the failures have the same form: the output is (XXX-0j) in stead of the expected (XXX+0j).
It isn't serious, and we've (you & I) been thru this failure before <wink>. If the compiler for this box has some sort of switch named along the lines of "don't used fused multiply-add", it should cure it.
Ah... Long ago in a universe far from here... I remember, I had the same problem on MacOS9 at some point.
But the strange thing with the current incarnation of the problem is that the exact same binary (build on OSX 10.2) passes test_coercion on 10.2 but fails it on 10.3. Could the C library be involved?
Or the compiler. Is Panther using the same gcc 3.3 as the last dev tools update? Cheers, mwh -- This is not to say C++ = bad, Lisp = good. It's to say C++ = bad irrespective of everything else. -- Alain Picard, comp.lang.lisp

On Tue, Jul 22, 2003 at 11:20:58PM +0200, Jack Jansen wrote:
I need a little guidance with bug #775892. I think it's non-serious, but I'm not sure (and I don't know how easy it is to fix).
Test_coercion is failing on the beta for MacOSX 10.3. All the failures have the same form: the output is (XXX-0j) in stead of the expected (XXX+0j).
This problem occurs on AIX and IRIX when using the vendor compilers IIRC. It's possible you can fix the problem by using a compiler flag which changes the math processing. This should be fixed generally sooner or later. Neal
participants (4)
-
Jack Jansen
-
Michael Hudson
-
Neal Norwitz
-
Tim Peters