upiterbarg / mpmath

Automatically exported from code.google.com/p/mpmath
Other
0 stars 0 forks source link

Error in mpf_abs #167

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I was refactoring some of the gmpy code and I encountered an error in
mpmath_normalize. I was receiving a 'False' instead of 0 for the sign
parameter. The old gmpy code defaulted to 0 when passed an invalid
parameter; now it raises an error.

I tracked it down to mpf_abs. The code:

        if sign:

            return (not sign, man, exp, bc)

should be:

        if sign:

            return (0, man, exp, bc)

I've made the change to my local copy and all tests pass. I didn't find any
other occurrences of 'not sign' that should cause a problem.

Case

Original issue reported on code.google.com by casevh on 22 Nov 2009 at 7:17

GoogleCodeExporter commented 9 years ago
I fixed my refactoring in gmpy. gmpy should accept True and False everywhere 
again.
It was a regression inadvertently added in v1.10.

Original comment by casevh on 24 Nov 2009 at 8:22

GoogleCodeExporter commented 9 years ago
Fixed in r1007.

Original comment by fredrik....@gmail.com on 12 Jan 2010 at 12:18