oh, thanksif (frac(number) == 0)
I hope you're careful with your code and math so you're not tripped up by rounding errors due to limited precision in floating point representation.oh, thanks
Less concerning that it sounds in GameMaker due to built-in epsilon.I hope you're careful with your code and math so you're not tripped up by rounding errors due to limited precision in floating point representation.
That is a good point, I suppose. Personally, I would rather have distinct data types and avoid coding that depends on floats having a close enough value. But gms/gml is what it is and I can live with it.Less concerning that it sounds in GameMaker due to built-in epsilon.
There's a distinct 64-bit integer type now. If the original poster decides to code in a numerically unstable way that precludes the use of fixed-point integers (e.g. storing a potentially fractional amount of dollars instead of a non-fractional amount of cents), that's his fault, not GM's.That is a good point, I suppose. Personally, I would rather have distinct data types and avoid coding that depends on floats having a close enough value. But gms/gml is what it is and I can live with it.
I hope you're careful with your code and math so you're not tripped up by rounding errors due to limited precision in floating point representation.
No, chamaeleon does have a good point.Less concerning that it sounds in GameMaker due to built-in epsilon.
var a = 1 - math_get_epsilon() * 0.5;
show_message(frac(a));
if (frac(number) == 0 || abs(frac(number)) == 1)
I don't believe that's relevant?There's a distinct 64-bit integer type now. If the original poster decides to code in a numerically unstable way that precludes the use of fixed-point integers (e.g. storing a potentially fractional amount of dollars instead of a non-fractional amount of cents), that's his fault, not GM's.