Python Forum
cmath.rect accepts a negative modulus
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
cmath.rect accepts a negative modulus
#1
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?
Reply


Messages In This Thread
cmath.rect accepts a negative modulus - by JMB - Jan-17-2024, 07:14 PM
RE: cmath.rect accepts a negative modulus - by JMB - Jan-17-2024, 08:00 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Did you know that map() accepts more than one iterable? DeaD_EyE 2 748 Apr-13-2025, 10:16 AM
Last Post: noisefloor
  negative memory usage akbarza 1 1,392 Apr-27-2024, 08:43 AM
Last Post: Gribouillis
  function accepts infinite parameters and returns a graph with those values edencthompson 0 1,425 Jun-10-2022, 03:42 PM
Last Post: edencthompson
  is there any tool to convert negative base to int? Skaperen 7 3,873 May-27-2022, 07:30 AM
Last Post: Gribouillis
  Pygame Rect Not Responding SomebodyImportant 1 2,218 May-02-2021, 01:27 PM
Last Post: BashBedlam
  Conceptualizing modulus. How to compare & communicate with values in a Dictionary Kaanyrvhok 7 5,841 Mar-15-2021, 05:43 PM
Last Post: Kaanyrvhok
  Def code does not work for negative integers. doug2019 1 2,667 Oct-31-2019, 11:00 PM
Last Post: ichabod801
  offset can not be negative in File.seek()? jollydragon 6 9,364 Sep-28-2019, 03:08 AM
Last Post: jollydragon
  Positive to negative bernardoB 6 5,890 Mar-13-2019, 07:39 PM
Last Post: bernardoB
  Why interpreter accepts indentation made with spaces and not those by tabs sylas 13 8,077 Jan-10-2019, 11:17 PM
Last Post: texadactyl

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020