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
| Name | Type | Description |
|---|---|---|
| x | real number | Input real value. |
| y | real number | Second real value. |
Return Value
float
Floating-point result; finite precision and domain restrictions apply.
Working Example
Example Snippetpython
import mathprint(math.remainder(7, 4))