Why is 0.1 + 0.2 returns 0.30000000000000004 in JavaScript?
Why is 0.1 + 0.2 returns 0.30000000000000004 in JavaScript?
medium.com Why is 0.1 + 0.2 returns 0.3000000004 in JavaScript?
Have you performed simple arithmetic operations like 0.1 + 0.2? You might have gotten something strange: 0.1 + 0.2 = 0.3000000004.
Have you performed simple arithmetic operations like 0.1 + 0.2? You might have gotten something strange: 0.1 + 0.2 = 0.30000000000000004.
You're viewing a single thread.
View all comments
25
comments
Floating-point arithmetic is important to understand at least vaguely since it’s a pretty leaky abstraction. Fortunately, we don’t need a "✨Member-only story" on Medium to get acquainted with the underlying concepts.
18 0 ReplyIt also includes a non member link
1 5 ReplyThat link didn't work for me.
1 0 Reply
You've viewed 25 comments.
Scroll to top