The math.fmod() function is used to calculate the remainder after a division between two numbers. It returns the remainder after the first number is divided by the second number.  For example: math.fmod(10, 3) This will return the result 1, as 10 divided by 3 is 3 with a remainder of 1.

Syntax:
math.fmod(number1, number2) 

Where number1 is the first number that will be divided and number2 is the second number.   

The function returns the remainder of number1/number2 as a floating point value.

The returned value is always in the same range as the first number. This means that if the first number is negative, the result of math.fmod() will also be negative.

ExampleEdit & Run
import math

>>> math.fmod(10, 3)
1.0
>>> math.fmod(-15, 4)
-3.0
>>> math.fmod(15, -4)
3.0
>>> math.fmod(-20, 5)
-0.0
>>> math.fmod(20, 6)
2.0
>>> math.fmod(25, 5)
0.0
>>> math.fmod(63, 7)
0.0
>>> math.fmod(100, 11)
1.0
>>> math.fmod(1000, 67)
62.0