Math Functions

math.fmod()

Compute the floating-point remainder with the dividend's sign, unlike the divisor-sign convention of %.

Formal Syntax & Structure

python syntaxpython
math.fmod(x, y, /)

Parameters & Attributes

NameTypeDescription
xreal numberInput real value.
yreal numberSecond real value.

Return Value

float

Floating-point result; finite precision and domain restrictions apply.

Working Example

Example Snippetpython
import mathprint(math.fmod(-11, 4))
Python Reference