floating point control in extensions

Discussion in 'Python' started by Robin Becker, Jul 13, 2003.

  1. Robin Becker

    Robin Becker Guest

    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, Jul 13, 2003
    #1
    1. Advertising

  2. Robin Becker

    Robin Becker Guest

    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

    1.0000000000000001e+290
    >>> a*a1.#INF
    >>>


    so I suppose only the obvious things are tested.
    -it's hard being an fpu'ly yrs-
    Robin Becker
     
    Robin Becker, Jul 14, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. H aka N
    Replies:
    15
    Views:
    15,837
    Ben Jones
    Mar 2, 2006
  2. Motaz Saad
    Replies:
    7
    Views:
    6,562
  3. Replies:
    4
    Views:
    1,340
    Default User
    Feb 22, 2006
  4. Saraswati lakki
    Replies:
    0
    Views:
    1,428
    Saraswati lakki
    Jan 6, 2012
  5. teeshift
    Replies:
    2
    Views:
    297
    Chris Pearl
    Dec 1, 2006
Loading...

Share This Page