DEV Community

Discussion on: Unexpected results… 0.1 + 0.2 = 🤯 (JavaScript)

Collapse
 
best_codes profile image
BestCodes

Yep. I've been working on a precise feels like calculation that takes data from temperature, humidity, pressure, and wind speed and give me a number — then I discovered that my number was inaccurate because, with this error in JS, and some rather important multiplication and exponents, my number got wacky very quickly.
Thankfully, there are JS libraries like Big.js and math.js to help solve these issues. 😅