
[Tim]
[Marco Sulla <Marco.Sulla.Python@gmail.com>]
Whoa. I'm quite curious about why. ...
There's no compelling reason to be had. They just made stuff up. In this case, it's apparently motivated by "OK, if the imaginary part is near 0, the number is very close to the x axis, and the sign of the real part determines on which side. Then we'll take the limit as the imaginary part approaches zero from the direction of its own sign." Why? Why not! The sign of a zero has no inherent "meaning". Note that these non-made-up results show that limiting process in action:
Make |pi| ever smaller, and the limits are clearly what the original example showed. I'll leave off (this really has nothing to do with Python, as nobody is volunteering to do anything in this area) with this link to more details than anyone can bear ;-) http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1399.htm As it says about two-argument complex functions: """ Since there are four components in (a+I*b)*(c+I*d), and each component can have four classifications, there are 4**4 or 256 cases to consider. The same is true for divide. That is why the reference implementation is so large. """ Their "four classifications" is understating it. They have in mind NaN, Inf, 0, or finite non-zero, but subdivisions within those classifications can breed even more special cases. "Bottomless pit."
participants (1)
-
Tim Peters