Function globals math mod
note - mathlib defines an fmod function (added after this was written) It uses C-library fmod(), which has different rounding behaviour to this code (eg, fmod(-5, 4) gives -1, whereas this code gives 3)
note - mathlib defines an fmod function (added after this was written) It uses C-library fmod(), which has different rounding behaviour to this code (eg, fmod(-5, 4) gives -1, whereas this code gives 3)