News for hackers. Stuff that matters.
Re:E-Stop and Fuel, software that keeps you awake at night by DiabloD3 on Sunday February 11, 2018 @04:00AM (#16351856)
Did you know in the US it's essentially against the law to use floating point math on currency? The situation is more complex than I simplified here, however the complexity is on the order than you'd need a lawyer to explain it to you to really appreciate it.

You can call it a knee-jerk reaction, but the law itself clearly has that bias, and for good reason.

All regulations were paved in blood.

Re:E-Stop and Fuel, software that keeps you awake at night by _0ffh on Sunday February 11, 2018 @07:29AM (#16352406)
Not just the US, IIRC financial institutions around the world are required to do decimal rounding. OTOH I don't see why you would even use floating point for money. Just scale your integers to the required precision (and make sure you've got enough bits for the kind of amounts you need to be able to handle) and you're good.
Re:E-Stop and Fuel, software that keeps you awake at night by davidcuddeback on Sunday February 11, 2018 @12:44PM (#16353687)
Having worked in both aerospace (GP's comment) and e-commerce (your comment), I can tell you that these are not the same problem and do not require the same solution.

First week on the job in e-commerce, I educated the junior engineers on the problems that can arise when using floating point math with currencies, then prioritized work to remove any floating point math from the code. That doesn't mean I wouldn't use floating point anywhere else. In aerospace in particular, I've used floating-point without issue, so I don't think you're point about currencies has any relevancy to the GP's comment regarding fuel estimation.

Re:E-Stop and Fuel, software that keeps you awake at night by phpnode on Sunday February 11, 2018 @05:12AM (#16352056)
Which law covers that?
Re:E-Stop and Fuel, software that keeps you awake at night by fnord77 on Sunday February 11, 2018 @10:32PM (#16356329)
fun fact - before 2001, the US stockmarket traded in sixteenths not decimals