Hacker News new | ask | show | jobs
by a1369209993 1482 days ago
Actually it's worse than that; they're talking about decimal floating point, which appears to work in obvious tests - $15.270 + $91.310 is $106.58. But (assuming 5 mantissa digits for example, but it works with any number), you can do the following:

  balance   91.31 [+291310]
         +1000.00 [+410000] temporary credit
  balance 1091.30 [+410913] ULP lost
         -1000.00 [-410000] temporary credit deducted
  balance   91.30 [+291300] successfully stole 1 cent
  repeat on each account/transaction/etc
Real examples are obviously less blatant than this, but you get the idea.

Decimal floating point should never be supported for anything in any capacity, and use of any floating point in financial software should be considered material proof of either gross incompentence or negligence, or intent to commit fraud.