Why JavaScript is a noob at math?

preview_player
Показать описание
Why do floats lie about their true value?

Computers have limited space to store each decimal number, so they can't always represent them with perfect accuracy. For instance, between 0.1 and 0.2 there is an infinite of numbers. There is no way that the computer can express an infinite set. Therefore decimal numbers are stored with limited precision. This means that adding two numbers together may be slightly off from the expected result.

#shorts, #shortvideo, #javascript, #javaprogramming, #js, #javascriptfunctions, #react, #coding, #codinginterview, #tipsandtricks

//Credit
Рекомендации по теме