Javascript Decimals are Broken?

preview_player
Показать описание
On javascript 0.1+0.2 is 0.30000000000000004

Sure, why not! Well.. it's floating point math :)

Computers can only natively store integers, so they need some way of representing decimal numbers. This representation is not perfectly accurate. This is why, more often than not, 0.1 + 0.2 != 0.3.

_______________________________
Hit like and subscribe for more content! :D

You can also follow me on the other platforms:

#javascript #js #programming
Рекомендации по теме