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?

TipRing
link
fedilink
149M

Hanging on with 1.70E-31 health.

Create a post

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.
  • 1 user online
  • 41 users / day
  • 161 users / week
  • 434 users / month
  • 2.41K users / 6 months
  • 1 subscriber
  • 1.61K Posts
  • 35.6K Comments
  • Modlog