News for hackers. Stuff that matters.
Re:What every computer programmer should know about floating... by AndrewOMartin on Tuesday September 16, 2014 @01:07PM (#8325530)
You may want to use a more intuitively behaving datatype for currency, even if just to avoid flame on certain community sites on the web. Consider an integer representing ten-thousandths of a penny, if guaranteed to stay in USD or GBP, or a dedicated currency library otherwise. Currency's just one of those things that makes some people very emotional when the notion of any kind of error or rounding is mentioned.

There are no comments on this comment yet.