Jan-17-2024, 07:14 PM
The function cmath.rect(r, phi) accepts negative values for r. For example: cmath.rect(-1, 0) returns (-1-0j).
The returned value is according to what is explained in the function documentation: r*(math.cos(phi) + math.sin(phi)*1j), but given that a negative modulus makes no sense, shouldn't the function return an Exception?
The returned value is according to what is explained in the function documentation: r*(math.cos(phi) + math.sin(phi)*1j), but given that a negative modulus makes no sense, shouldn't the function return an Exception?