Math Functions

math.remainder()

Subtract the nearest integer multiple of the divisor, choosing an even quotient in a tie. The magnitude is at most half the divisor magnitude.

Formal Syntax & Structure

python syntaxpython
math.remainder(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.remainder(7, 4))
Python Reference