Re: Mathematics in Python are not correct

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Luis Zarrabeitia

    Re: Mathematics in Python are not correct


    Quoting Christian Heimes <lists@cheimes. de>:
    Luis Zarrabeitia schrieb:
    >>0**0
    1

    That 0^0 should be a nan or exception, I guess, but not 1.
    No, that's correct for floats. Read the wikipedia article or the C99
    standard for more information.
    Weird, I can't find neither... (which wikipedia article? Couldn't find one about
    C99.)
    Don't take me wrong, I believe you... but I would really want to see the logic
    behind that. I pretty much like the NaNs and Infs (and don't really understand
    why python raises float division errors instead of them), but to have errors
    pass with absolute silence seems dangerous even if it is useful sometimes
    (Vandermonde example). I think I'd rather have python returning NaNs and
    violating C99 on the 0**0=1, than to have 0**0=1 and not return NaNs.


    --
    Luis Zarrabeitia
    Facultad de Matemática y Computación, UH

    --
    "Al mundo nuevo corresponde la Universidad nueva"
    UNIVERSIDAD DE LA HABANA
    280 aniversario
Working...