Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
imaginary number i
#8
(Sep-23-2021, 03:59 PM)deanhystad Wrote: The reason -1**0.5 == -1 is that ** has higher precedence than unary -.

The reason (-1)**5 ~= 1j is that the parenthesis change the order of operations. Unary - is first, then **. As for the small remainder,
you don't need imaginary numbers to see that you cannot represent an infinite set of numbers using a limited set of bytes.

This is the first programming language that I see to give priority to "power" than to sign "-"
Reply


Messages In This Thread
imaginary number i - by mr_byte31 - Sep-23-2021, 12:08 PM
RE: imaginary number i - by bowlofred - Sep-23-2021, 03:26 PM
RE: imaginary number i - by deanhystad - Sep-23-2021, 03:59 PM
RE: imaginary number i - by mr_byte31 - Sep-23-2021, 04:28 PM
RE: imaginary number i - by mr_byte31 - Sep-23-2021, 04:01 PM
RE: imaginary number i - by bowlofred - Sep-23-2021, 04:13 PM
RE: imaginary number i - by jefsummers - Sep-23-2021, 04:10 PM
RE: imaginary number i - by deanhystad - Sep-23-2021, 04:20 PM
RE: imaginary number i - by buran - Sep-23-2021, 05:42 PM

Forum Jump:

User Panel Messages

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