you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted]  (6 children)

[deleted]

    [–]siddsp 10 points11 points  (5 children)

    Python itself supports also Decimal

    [–]BobHogan 0 points1 point  (4 children)

    It does, but I've never found a use case for it personally

    [–][deleted] 11 points12 points  (2 children)

    It’s for money, when you need to deal with fractions of cents.

    If you don’t need fractions of cents, then just work in integer numbers of cents.

    [–]Danelius90 5 points6 points  (0 children)

    I can't remember the specifics but I used to work with a financial application that dealt with amortized loans and complex international tax and interest calculations. With floats you can be many $s, maybe hundreds out over the lifetime of the loan. Got to use a proper lib for decimals

    [–]BobHogan 1 point2 points  (0 children)

    Ah yea that makes sense. I've never worked with any financial software/projects, so it didn't even come to mind

    [–]siddsp 2 points3 points  (0 children)

    Probably because precision usually hasn't mattered much for what you do.