3 ms·
JS WTF with Math
- Gibbon1 9y ago> 0.1 + 0.2 == 0.3 // false > This is not a problem of JS to be fair. This is floating point math. This is binary floating point math, which shouldn't be the default in a language like JS. And in any event it's a design flaw for a language to blithely convert 0.2 which is decimal floating point to binary floating point without being asked.