JavaScript is Crazy - Part 2
Hello Folks 👋
What’s up friends, this is SnowBit here. I am a young passionate and self-taught developer and have an intention to become a successful developer.
Today, I am here again with a crazy thing in JavaScript.
So, let’s get started.
console....
h.dhairyashah.dev2 min read
TheSudarsanDev
A full stack developer...
The reason behind why 0.1 + 0.2 == 0.3 is false because computer uses base 2 floating point numbers. And when it converts it into human readable base 10 floating point numbers, such errors happen.
Another example error is 0.1 * 0.1 == 0.01