In TIL: Floating Point Math https://0.30000000000000004.com/ "Your language isn’...

@jmccyoung@mstdn.social

In TIL: Floating Point Math
0.30000000000000004.com/
"Your language isn’t broken, it’s doing 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."