Velocity Reviews

Velocity Reviews (
-   Python (
-   -   floating point control in extensions (

Robin Becker 07-13-2003 09:52 AM

floating point control in extensions
Is there a preferred way to intercept floating point exceptions in
python extensions? I assume one should be careful to restore any
existing error handler. Does python have a standard mechanism for
setting up fpu control words etc?
Robin Becker

Robin Becker 07-14-2003 08:03 AM

Re: floating point control in extensions
In article <>, Tim Peters
<> writes
>Python itself assumes that no-stop mode is in effect (the IEEE-754 mandated
>default: all FPU traps are disabled).

That at least makes resetting easy when one can do it.

I guessed all Python floating point ops are tested either pre or post
for the correct outcome, but then I tried

>>> a=1e290
>>> a

>>> a*a1.#INF

so I suppose only the obvious things are tested.
-it's hard being an fpu'ly yrs-
Robin Becker

All times are GMT. The time now is 07:49 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.