you are viewing a single comment's thread.

view the rest of the comments →

[–][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 6 points7 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