floor() rounds down. int() truncates. The difference is clear when you use negative numbers:

>>> import math
>>> math.floor(-3.5)
-4
>>> int(-3.5)
-3

Rounding down on negative numbers means that they move away from 0, truncating moves them closer to 0.

Putting it differently, the floor() is always going to be lower or equal to the original. int() is going to be closer to zero or equal.

Answer from Martijn Pieters on Stack Overflow
๐ŸŒ
Python
docs.python.org โ€บ 3 โ€บ library โ€บ math.html
math โ€” Mathematical functions
Return the ceiling of x, the smallest ... value. ... Return the absolute value of x. ... Return the floor of x, the largest integer less than or equal to x....
๐ŸŒ
W3Schools
w3schools.com โ€บ python โ€บ ref_math_floor.asp
Python math.floor() Method
The math.floor() method rounds a number DOWN to the nearest integer, if necessary, and returns the result.
๐ŸŒ
Codecademy
codecademy.com โ€บ docs โ€บ python โ€บ math module โ€บ math.floor()
Python | Math Module | math.floor() | Codecademy
April 23, 2025 - The ceil of 2.9 equals 3 because math.ceil() rounds up to the nearest integer. These functions work in opposite ways - floor rounds down, while ceil rounds up.
๐ŸŒ
Note.nkmk.me
note.nkmk.me โ€บ home โ€บ python
Round Up/Down Decimals in Python: math.floor, math.ceil | note.nkmk.me
January 15, 2024 - While math.floor() rounds toward negative infinity, int() instead rounds toward zero. print(int(-10.123)) # -10 print(int(-10.987)) # -10 ... Additionally, int() can convert strings (str) to integers (int).
๐ŸŒ
The Data School
thedataschool.co.uk โ€บ randee-johnson โ€บ untitled-130
INT vs. FLOOR: What is the difference and when does it matter? - The Data School
INT (short for integer) * Takes a value and returns its closest integer that is also CLOSEST to zero. * Keyword(s): CLOSEST (to 0)! FLOOR * Takes a value and rounds it to the nearest SMALLEST integer
Find elsewhere
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ floor-ceil-function-python
floor() and ceil() function Python - GeeksforGeeks
In Python, math module contains a number of mathematical operations, which can be performed with ease using the module. math.floor() function returns the largest integer not greater than x. If number is already integer, same number is returned.
Published ย  April 8, 2025
๐ŸŒ
Python Forum
python-forum.io โ€บ thread-9009.html
Is // operator is the same as math.floor()
I am under the assumption 10 // 3 operation(Integer division) is the same as math.floor(10/3). The results are the same for this simple arithmetic problem. But I am wording if they are interchangeable
๐ŸŒ
Learn Coding Fast
learncodingfast.com โ€บ home โ€บ python math.floor() function
Python math.floor() function | Learn Coding Fast
September 1, 2020 - This function is another built-in function in Python and is used to convert a string or number to an integer. In some cases, it achieves the same result as the floor() function. However, there are two key differences between the int() and floor() functions. Firstly, we do not need to import the math module to use the int() function.
๐ŸŒ
Tutorial Gateway
tutorialgateway.org โ€บ math-floor-in-python
math floor in Python
March 29, 2025 - Python math floor is a math library function and the Floor returns the closest integer value which is less than or equal to specified exp.
๐ŸŒ
Initial Commit
initialcommit.com โ€บ blog โ€บ python-floor-function
A Detailed Look at the Python floor() Function
That's because, as soon as temperatures start to drop below zero ([-0.1, -0.2, -0.3, ...]), the app will send the proper notification, as floor() will round these temperatures down to -1. Had you used round() or int() instead, then the app would experience a delay, with temperatures ranging from -0.1 to -0.9 degrees without any notification being sent. As we've seen in Texas in February 2021, early warnings are critical when it comes to freezing temperatures. The Python floor() function will ensure you're returning the right value every time. The Python standard library also contains several numeric constants that can be accessed through the math module.
๐ŸŒ
Tutorialspoint
tutorialspoint.com โ€บ python โ€บ number_floor.htm
Python math.floor() Method
This object is passed as an argument to the floor() method, in order to retrieve the integer part of this number; whereas calculating the modulus of this number using 1 will retrieve its decimal part. import math # This will import math module ...
๐ŸŒ
datagy
datagy.io โ€บ home โ€บ python posts โ€บ python floor: rounding down with python
Python Floor: Rounding Down with Python โ€ข datagy
April 13, 2023 - Want to learn more about Python for-loops? Check out my in-depth tutorial that takes your from beginner to advanced for-loops user! Want to watch a video instead? Check out my YouTube tutorial here. While reading this tutorial, it may seem that we are really only removing the pieces following a decimal. In this case, you may be wondering why we wouldnโ€™t simply convert the float to an integer. Letโ€™s take a look at an example where this seems to work: print(math.floor(3.7)) print(int(3.7)) # Returns: # 3 # 3
๐ŸŒ
Quora
quora.com โ€บ What-does-the-function-math-floor-in-Python-mean
What does the function 'math.floor' in Python mean? - Quora
Answer (1 of 7): In Python 2 > math.floor(x) returns floor of x as a float, the largest integer value less than or equal to x. [code]>>> import math >>> print("math.floor(-99.99) : ", math.floor(-99.99)) ('math.floor(-99.99) : ', -100.0) >>> print("math.floor(100.01) : ", math.floor(100.01)) ('...
๐ŸŒ
Python.org
discuss.python.org โ€บ ideas
Make float.__(i/r)floordiv__ return an int - Page 4 - Ideas - Discussions on Python.org
March 23, 2023 - The // operation is made to return an integer value. However, when either operand is a float, the result is an integer in the form (type) of a float. I think there are several advantages to making this return an int. Fโ€ฆ
๐ŸŒ
Wikipedia
en.wikipedia.org โ€บ wiki โ€บ Floor_and_ceiling_functions
Floor and ceiling functions - Wikipedia
February 5, 2026 - Many programming languages (including C, C++, C#, Java, Julia, PHP, R, and Python) provide standard functions for floor and ceiling, usually called floor and ceil, or less commonly ceiling. The language APL uses โŒŠx for floor. The J Programming Language, a follow-on to APL that is designed to use standard keyboard symbols, uses <. for floor and >. for ceiling. ALGOL usesentier for floor. In Microsoft Excel the function INT rounds down rather than toward zero, while FLOOR rounds toward zero, the opposite of what "int" and "floor" do in other languages.