Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Floating-point literals are confusing. The basic arithmetic less so (although it too has some pitfalls). I said this before, but I think inexact literals (which are very common) should cause warnings in languages where used.

    >>> 9999999999999999.0 == 10000000000000000.0
    True
    >>> from decimal import Decimal as D
    >>> D(9999999999999999.0)
    Decimal('10000000000000000')
"It's a simple question" I find it very much not simple question; indeed I'm not sure what is the expected "right answer" here?


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: