Post Reply 
Plus42 Equations, Preview Release
03-30-2022, 10:38 PM
Post: #479
RE: Plus42 Equations, Preview Release
(03-30-2022 08:01 PM)Thomas Okken Wrote:  Hmmm... for all integer exponents?

Python limited integer squaring to +/- 100, "normal" complex pow beyond that.
source: complexobject.c, static Py_complex c_powi(Py_complex x, long n)

This is Python 2.6 (newer version is similar)

>>> z = 3+4j
>>> z100 = z**100
>>> abs(z - z**101/z100), abs(z - z100/z**99)
(2.4565801279300335e-14, 9.9301366129890925e-16)
>>>
>>> z = 4+5j
>>> z100 = z**100
>>> abs(z - z**101/z100), abs(z - z100/z**99)
(1.7680105590573434e-14, 0.0)
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Plus42 Equations, Preview Release - Albert Chan - 03-30-2022 10:38 PM



User(s) browsing this thread: 15 Guest(s)