2 ms·
I remember having to write something similar for Lua, because there was no math.approximately() function and I was dealing with networking floats and comparing
by andrewmcwatters 5y ago
I remember having to write something similar for Lua, because there was no math.approximately() function and I was dealing with networking floats and comparing values over the wire to predicted movement in 2D space.
https://github.com/Planimeter/grid-sdk/blob/master/engine/shared/mathlib.lua#L18 https://github.com/Planimeter/grid-sdk/blob/master/engine/sh...
https://en.wikipedia.org/wiki/Machine_epsilon https://en.wikipedia.org/wiki/Machine_epsilon
https://pubs.opengroup.org/onlinepubs/009696899/basedefs/float.h.html https://pubs.opengroup.org/onlinepubs/009696899/basedefs/flo...