Timeline for Is this number Loeschian?
Current License: CC BY-SA 4.0
8 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jul 16, 2020 at 7:25 | comment | added | Mark Dickinson |
Thanks! I had no idea % worked with complex numbers in Python 2. (Apparently the behaviour was deprecated back in 2002, but not removed until Python 3: bugs.python.org/issue543387.)
|
|
Jul 15, 2020 at 20:32 | comment | added | xnor |
@MarkDickinson This is Python 2. At least, it works in 2.7. I wasn't aware that complex % isn't available in Python 3 -- thanks for pointing this out.
|
|
Jul 15, 2020 at 20:30 | history | edited | xnor | CC BY-SA 4.0 |
added 261 characters in body
|
Jul 15, 2020 at 18:31 | comment | added | Mark Dickinson |
Is this Python 3? If so, the +0j isn't necessary: some_negative_int**0.5 already gives a complex number. But I don't see how the % operation will work with either Python 2 or Python 3, given that you can't use % on complex numbers. What version of Python was this solution written for?
|
|
Jul 15, 2020 at 2:40 | comment | added | uhoh | interesting new comment | |
Jun 8, 2020 at 4:27 | comment | added | xnor | @uhoh I should note that comment of mine isn't quite correct -- it's only true up to some limit. Interested in the answers to your question there. | |
Jun 8, 2020 at 4:03 | comment | added | uhoh | perfect square stuff is good to know, but how did you know this? I've just asked How (and why) does “Python compute square roots of perfect squares exactly”? | |
Aug 4, 2016 at 20:46 | history | answered | xnor | CC BY-SA 3.0 |