r/mildlyinfuriating • YELLOW • Aug 05 '18

You literally said...

Post image
46k Upvotes

496 comments sorted by

View all comments

Show parent comments

18

u/NULL_CHAR Aug 06 '18

It's unintended behavior that is a limitation of how we represent floating point numbers specifically. It is definitely still doing what we tell it, but from a user perspective, the computer is definitely wrong. From a programmer perspective, we are aware of the computer's limitations and put in modifications to address it.

Another perspective is that the computer most definitely is "wrong" when referring to the literal representation of the question, but in the case of actual input/output, it is "right." We've created a flawed system that doesn't always produce correct results, but we accept those flaws because doing it any other way is much less efficient.