homepage

This issue tracker has been migrated to GitHub , and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author skip.montanaro
Recipients mark.dickinson, skip.montanaro
Date 2008年12月04日.15:49:40
SpamBayes Score 7.260962e-07
Marked as misclassified No
Message-id <18743.64529.80385.143932@montanaro-dyndns-org.local>
In-reply-to <1228339825.17.0.783504500876.issue4506@psf.upfronthosting.co.za>
Content
Mark> If you have time, could you try the attached patch and report what
 Mark> gets printed when cmath.exp(710+1.5j) is called? On my machine, I
 Mark> get:
 ...
Looks similar here:
 % ./python
 Python 3.0 (r30:67503, Dec 3 2008, 14:46:39)
 [GCC 4.2.2] on sunos5
 Type "help", "copyright", "credits" or "license" for more information.
 >>> import cmath
 >>> cmath.exp(complex(710.0, 1.5))
 r.real, r.imag: 1.58027e+307, Inf
 Py_IS_INFINITY(r.real), Py_IS_INFINITY(r.imag): 0, 1
 Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
 OverflowError: math range error
If I then comment back out your two printf statements and recompile, it once
again fails to raise OverflowError:
 % ./python
 Python 3.0 (r30:67503, Dec 3 2008, 14:46:39)
 [GCC 4.2.2] on sunos5
 Type "help", "copyright", "credits" or "license" for more information.
 >>> import cmath ; cmath.exp(complex(710.0, 1.5))
 (1.5802653829857376e+307+inf*j)
Very weird. If I uncomment either of your printf statements OverflowError
seems to be raised as expected. It's as if some register bit isn't being
set unless you reference r.real or r.imag multiple times.
Skip
History
Date User Action Args
2008年12月04日 15:49:42skip.montanarosetrecipients: + skip.montanaro, mark.dickinson
2008年12月04日 15:49:41skip.montanarolinkissue4506 messages
2008年12月04日 15:49:40skip.montanarocreate

AltStyle によって変換されたページ (->オリジナル) /