this post was submitted on 28 Mar 2024
615 points (98.1% liked)

Programmer Humor

32453 readers
1341 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[โ€“] [email protected] 7 points 7 months ago (1 children)

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?

[โ€“] [email protected] 14 points 7 months ago

Hanging on with 1.70E-31 health.