Garry's Mod Wiki

math.fmod

  number math.fmod( number base, number modulator )

Description

Returns the modulus of the specified values.

While this is similar to the % operator, it will return a negative value if the first argument is negative, whereas the % operator will return a positive value even if the first operand is negative.

Arguments

1 number base
The base value.
2 number modulator
The modulator.

Returns

1 number
The calculated modulus.