Math Functions

math.floor()

Round toward negative infinity. For non-floats, may dispatch to __floor__.

Formal Syntax & Structure

python syntaxpython
math.floor(x, /)

Parameters & Attributes

NameTypeDescription
xreal numberInput real value.

Return Value

int

An integral result; custom hooks should return an integral value.

Working Example

Example Snippetpython
import mathprint(math.floor(-2.7))
Python Reference