Floating point errors are a product of how floating points work as a mathematical concept. So they’re independent of the programming language and can happen everywhere.
In this case though, I doubt it’s a critical issue. So the player “died” when they actually had 0.000000000027 hp left or whatever. Who cares? Do you need to be that precise?
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !programmerhumor@lemmy.ml
Post funny things about programming here! (Or just rant about your favourite programming language.)
Rules:
Posts must be relevant to programming, programmers, or computer science.
No NSFW content.
Jokes must be in good taste. No hate speech, bigotry, etc.
Floating point errors are a product of how floating points work as a mathematical concept. So they’re independent of the programming language and can happen everywhere.
In this case though, I doubt it’s a critical issue. So the player “died” when they actually had 0.000000000027 hp left or whatever. Who cares? Do you need to be that precise?
Hanging on with 1.70E-31 health.