Fmod Function - Python Math Module

Overview:

  • The function fmod() returns the floating point remainder of the division operation x/y of two numbers.

Example:

# Example Python program that returns the floating point
# remainder of x/y
import math

num1 = 10.5
num2 = 2.5

# Calculate the remainder
rem = math.fmod(num1, num2)
print("Remainder:")
print(rem)

Output:

Remainder:

0.5

 


Copyright 2023 © pythontic.com