Important Notice:

Course Content
The Calendar Module
Library Function/Predefined Functions
0/4
Sys Module
Library Function/Predefined Functions
0/2
OS Module
Library Function/Predefined Functions
0/2
Functions in Python (Chapter-10) M3-R5
About Lesson

Math.fmod():-

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

Example

Return the remainder of x/y:

import math

print(math.fmod(20, 4))

print(math.fmod(20, 3))

print(math.fmod(15, 6))

print(math.fmod(-10, 3))

print(math.fmod(0, 0))

Output:

0.0

2.0

3.0

-1.0

print(math.fmod(0, 0))

ValueError: math domain error

error: Content is protected !!