Operator Functions

operator.floordiv()

Floor division rounds toward negative infinity for integers, not toward zero. Equivalent to a // b; custom operand types control the result.

Formal Syntax & Structure

python syntaxpython
operator.floordiv(a, b, /)

Parameters & Attributes

NameTypeDescription
aobjectLeft operand or target object.
bobjectRight operand.

Return Value

object

The object result described above.

Working Example

Example Snippetpython
import operatorprint(operator.floordiv(-7, 3))
Python Reference