News for hackers. Stuff that matters.
Re:Fans of a 2013 Japanese soccer game tracked down a bizarr... by esrauch on Tuesday September 07, 2021 @12:08PM (#28446427)
They mention precision bit then actually gave the example that if all inputs were exactly 0 that it gave differing results of +0 vs -0. Presumably the game checked the sign of the result and hit an error recovery codepath if it was negative.

That's not really something that unlimited precision would avoid, but also not something that "real" arithmetic suffers from since real arithmetic doesn't have -0 and +0 as distinguishable concepts.

Re:Fans of a 2013 Japanese soccer game tracked down a bizarr... by adrian_b on Tuesday September 07, 2021 @03:03PM (#28448558)
You are right that for that place in the game this probably exposed a bug in the original game.

Normally testing the sign of a floating-point number that is the result of a multiplication or division should always be preceded by a test for zero, unless you intentionally want to take different paths for zeros with different signs.