[issue41245] cmath module documentation is misleading on branch cuts

Raymond Hettinger report at bugs.python.org
Wed Jul 8 14:41:21 EDT 2020


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

+1 for changing the language to match the actual mechanics.


> "the sign of the imaginary part of x is used [...]"

I'm trying to see where this happens.  Is this part of cmath_sqrt?

    if (z.real >= 0.) {
        r.real = s;
        r.imag = copysign(d, z.imag); 
    } else {
        r.real = d;
        r.imag = copysign(s, z.imag);
    }


> "continuous from below" and "continuous from above" 
> language is misleading;

I'm curious, is that language incorrect?  My mental image of a branch cut is a helical graph with the edge cases being continuous from above and below.  Likewise, my mental model for branch cut logic is it resolves multiple possible output values in a way preserves continuity from one side or the other.

In other words, I think about branch cuts in terms of continuity rather than sign preservation.  Is that incorrect?

----------
nosy: +rhettinger

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41245>
_______________________________________


More information about the Python-bugs-list mailing list