A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.w3schools.com/python/ref_math_fmod.asp below:

Website Navigation


Python math.fmod() Method

Python math.fmod() Method

❮ Math Methods

Example

Return the remainder of x/y:

# Import math Library

import math

# Return the remainder of x/y

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))

Try it Yourself » Definition and Usage

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

Syntax 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

❮ Math Methods

Track your progress - it's free!


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4