Math.sum Floating Point Fail
Good news: `Math.sum` is coming to JS as a way to do more precise floating point math Bad news: Math.sum([0.1, 0.2]) === 0.3; false
A dark-mode social media post announces that JavaScript may get Math.sum for more precise floating-point arithmetic, then shows Math.sum([0.1, 0.2]) === 0.3 returning false. The joke is that even a supposedly precise math feature still fails the classic 0.1 + 0.2 floating-point comparison, making it a reaction to programming bugs and ironic “good news, bad news” situations.
social media post / пост в соцсетиJavaScript code / код JavaScriptcode editor console / консоль редактора кодаfloating-point numbers / числа с плавающей точкойgreen mathematical text / зелёный математический текстpurple false result / фиолетовый результат falsedark mode interface / интерфейс в тёмном режиме
- @ithueti / 12692 2024-04-29
- Template
- Good news, bad news
- Type
- image
- Size
- 750×631 · 27.1 KiB
- Mood
- sarcastic, absurd
- Language
- en
- Added