Python math.fmod() Method

Math Methods : Return the remainder of x/y

Definition and Usage

The math.fmod() method returns the remainder (modulo) of x/y.

Syntax

math.fmod(x, y)

Parameter Values

Parameter Description
x Required. A positive or negative number to divide
y Required. A positive or negative number to divide x with
Note: If both x and y = 0, it returns a ValueError.
Note: If y = 0, it returns a ValueError.
Note: If x or y is not a number, it returns a TypeError.

Technical Details

Return Value: A float value, representing the remainder of x/y
Python Version: 1.4