[issue41245] cmath module documentation is misleading on branch cuts
Mark Dickinson <dickinsm@gmail.com> added the comment: Yes, that looks like the right part of the sqrt code. For the acos docstring, "continuous from below" implies that for any complex number z that lies exactly _on_ the branch cut, acos(z) is close to acos(w) for a nearby value w just _below_ the branch cut. But that's demonstrably not true: see the change of sign in the real part below:
acos(complex(2.3, -1e-10)) # value just "below" the branch cut (4.828045495852677e-11+1.475044781241425j) acos(complex(2.3, 0.0)) # nearby value exactly _on_ the branch cut -1.475044781241425j
In effect, for a branch cut along the real axis, the sign of the zero in the imaginary part of the argument allows us to be continuous from both sides at once. ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue41245> _______________________________________
participants (1)
-
Mark Dickinson