floating point control in extensions

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Robin Becker

    #1

    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

    #2
    Re: floating point control in extensions

    In article <mailman.105811 9520.21914.pyth on-list@python.org >, Tim Peters
    <tim.one@comcas t.net> writes
    .......[color=blue]
    >Python itself assumes that no-stop mode is in effect (the IEEE-754 mandated
    >default: all FPU traps are disabled).
    >[/color]
    .....
    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
    [color=blue][color=green][color=darkred]
    >>> a=1e290
    >>> a[/color][/color][/color]
    1.0000000000000 001e+290[color=blue][color=green][color=darkred]
    >>> a*a1.#INF
    >>>[/color][/color][/color]

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

    Comment

    Working...