Strange Subtraction Bug

Hello, Roblox forgot how to do math.

I have a function that prints how much time is left on a cooldown floored to the nearest 10^-x of a second, which works perfectly fine to figure out how much time has passed since the cooldown started.

BUT, when I try and subtract this value from the cooldown to get the remaining amount of time, sometimes I get an unrounded number.


This happens randomly, and increases in frequency until I get to 0.xx, where it always gives me a stupidly long unrounded number. I know it’s definitely a bug on Roblox’s end, because if I remove the subtraction statement I get perfectly floored numbers, even at the dreaded 0’s:


Is there any way I can fix this?

Try this after subtracting use math.floor or math.ciel or math.round, whatever suits you the best.

TimeYouGot = math.floor(TimeYouGot * 100) / 100
1 Like