fmod()
noahpgordon38 total contributions
Published Oct 26, 2023
Contribute to Docs
The method fmod()
takes two numbers and returns the remainder of the first number divided by the second number.
Syntax
The syntax of fmod()
is as follows:
math.fmod(num1, num2)
Where num1
is the value to be divided by num2
.
Examples
The following examples illustrate the behavior of fmod()
:
print(math.fmod(6, 4))print(math.fmod(4, 6))print(math.fmod(12, 4))print(math.fmod(8.04829, 1))print(math.fmod(4.63, 2.89))print(math.fmod(0, 9))
This results in the output:
2400.048291.740
Looking to contribute?
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.