GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Improve accuracy for complex powers with small negative integer exponents · Issue #156695 · python/cpython Open Open Copy link Labels interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-featureA feature request or enhancementA feature request or enhancement DescriptionFeature or enhancementProposal:Currently we compute such powers as For example: >>> from gmpy2 import * >>> import math >>> x, y = map(float.fromhex, ['0x1.47e9c711723f5p+81', ... '0x1.38afd1168e49fp+85']) >>> z = complex(x, y) >>> pr = pow(z, -12); pr 0j >>> pr2 = pow((1/z), 12); pr2 (5.562684646267994e-309+5.56268464626799e-309j) >>> gr = complex(pow(mpc(z), -12)) >>> abs((pr2-gr).real)/math.ulp(gr.real) 2.0 >>> abs((pr2-gr).imag)/math.ulp(gr.imag) 2.0 Using instead >>> import _testcapi >>> pr3 = _testcapi._py_c_pow(z, -12)[0]; pr3 (5.56268464626801e-309+5.56268464626799e-309j) >>> abs((pr3-gr).real)/math.ulp(gr.real) 1.0 >>> abs((pr3-gr).imag)/math.ulp(gr.imag) 2.0 Has this already been discussed elsewhere?This is a minor feature, which does not need previous discussion elsewhere Links to previous discussion of this feature:No response Linked PRsReacted by Aniket Activity
MetadataMetadataAssigneesLabelsinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-featureA feature request or enhancementA feature request or enhancement ProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |