Closed tfidfwastaken closed 3 years ago
Assigning @anihm136 and @Gituser143 for comments and approval. :p
@tfidfwastaken you've got me curious about how you plan to get a blog post outta this! I'm not sure what you've got planned, but I want to see it. Make it happen fast fast, thanks xD
Looks very exciting! Eagerly awaiting the post
Also, @tfidfwastaken, this isn't really the case in Go. You might want to look into that. Here's a link which let's you try this out online (It's called the Go Playground).
@Gituser143 It's actually there in Go as well, just masked a little better. That said my title was a little inaccurate for Go's case Put those numbers in variables and it still happens.
The reason for that will indirectly be explained in my post as well :)
Title: 0.1 + 0.2 and other fantastic ways to make money disappear
Abstract:
Type
0.1 + 0.2 == 0.3
into the Python interpreter. Yep. It's false. Before you throw away Python, try it out in C. And C++. Also Java, Go, Rust, Julia or Assembly.Let's explore why this bug in all languages that can never be "fixed", and how we go around it to make sure stock markets don't collapse and your weapons of mass destruction don't hit the wrong place.
Who is your target audience with this post? Be as specific as you can.
All programmers who have to concern themselves with floating point calculations. This is some important stuff that nobody taught us which is a big sad.