Skip to content

int

Round down to the nearest integer.

v = int(number)

Returns the largest integer less than or equal to number. Same as floor for positive numbers; for negative numbers, int(-2.5) is -3, not -2.

int(8.7) % 8
int(-8.7) % -9
  • floor — Round toward negative infinity.
  • trunc — Truncate toward zero.