int(x)

Conversion to integer will truncate (towards 0.0), like math.trunc.
For non-negative numbers, this is downward.

If your number can be negative, this will round the magnitude downward, unlike math.floor which rounds towards -Infinity, making a lower value. (Less positive or more negative).

Python integers are arbitrary precision, so even very large floats can be represented as integers. (Unlike in other languages where this idiom could fail for floats larger than the largest value for an integer type.)

Answer from Ghostwriter on Stack Overflow
🌐
FavTutor
favtutor.com › blogs › round-down-python
Round Down Numbers in Python (With Examples and Code)
September 3, 2022 - It rounds down the negative number away from zero (Here, -0.6 to 1). Python's floor division operator, aka the integer division operator, is like math.floor() method. It divides the first number by the second and then rounds down the result ...
🌐
Real Python
realpython.com › python-rounding
How to Round Numbers in Python – Real Python
December 7, 2024 - Then look at the digit d in the first decimal place of m. If d is less than 5, round m down to the nearest integer. Otherwise, round m up. Finally, shift the decimal point back p places by dividing m by 10ᵖ.
Discussions

How to round numbers below?
Use math.floor() to round down. https://docs.python.org/3/library/math.html#math.floor More on reddit.com
🌐 r/learnpython
7
November 29, 2024
Question: how to round In python?
You don't want to round it, you want to floor it, which lowers the number to the nearest whole. >>> import math >>> math.floor(91.66667) 91 >>> math.floor(99.9) 99 >>> math.floor(2.1) 2 More on reddit.com
🌐 r/learnpython
9
3
September 30, 2018
How would I make a python round down a number.
Import math and use math.floor() More on reddit.com
🌐 r/CodingHelp
2
1
November 16, 2020
Python Round() Function
Found an answer on https://www.programiz.com/python-programming/methods/built-in/round Note: The behavior of round() for floats can be surprising. Notice round(2.675, 2) gives 2.67 instead of the expected 2.68. This is not a bug: it's a result of the fact that most decimal fractions can't be represented exactly as a float. When the decimal 2.675 is converted to a binary floating-point number, it's again replaced with a binary approximation, whose exact value is: 2.67499999999999982236431605997495353221893310546875 Due to this, it is rounded down to 2.67. If you're in a situation where this precision is needed, consider using the decimal module, which is designed for floating-point arithmetic: from decimal import Decimal # normal float num = 2.675 print(round(num, 2)) # using decimal.Decimal (passed float as string for precision) num = Decimal('2.675') print(round(num, 2)) Hope this helps! More on reddit.com
🌐 r/learnpython
7
1
July 9, 2021
🌐
freeCodeCamp
freecodecamp.org › news › how-to-round-numbers-up-or-down-in-python
Python Round to Int – How to Round Up or Round Down to the Nearest Whole Number
May 24, 2022 - We'll also see how to use the function's parameters to change the type of result returned to us. We'll then talk about the math.ceil() and math.floor() methods which rounds up and rounds down a number to the nearest whole number/integer respectively.
🌐
Altcademy
altcademy.com › blog › how-to-round-down-in-python
How to round down in Python
June 13, 2023 - When choosing a method for rounding ... consistent rounding down behavior for both positive and negative numbers, the math.floor() function is the best choice....
🌐
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.
Find elsewhere
🌐
Note.nkmk.me
note.nkmk.me › home › python
Round Up/Down Decimals in Python: math.floor, math.ceil
January 15, 2024 - Convert a string to a number (int, float) in Python · print(int('10')) # 10 # print(int('10.123')) # ValueError: invalid literal for int() with base 10: '10.123' print(int('FF', 16)) # 255 ... Considering negative values, there are four ways to round up and down.
🌐
Server Academy
serveracademy.com › blog › python-round-function-tutorial
Python Round() Function Tutorial - Server Academy
Python’s round() function makes it easy to round numbers to a specified number of decimal places or the nearest integer. Whether you need to round up, round down, or round to a specific decimal point, Python has you covered with its versatile round() function.
🌐
Codecademy
codecademy.com › forum_questions › 52a9f3647c82cafcc7000125
Python rounds down at .5 | Codecademy
(discalimer: I did some basic research, and this is what I got) I’d take a look here: http://stackoverflow.com/questions/6569528/python-float-to-int-conversion-problem · Basically a floating point value may not be 100% exact the way it is stored, but it knows what that floating point value is. Whenever you call int though, it truncates the value after the decimal, which results in your odd values/rounding.
🌐
Vultr Docs
docs.vultr.com › python › third-party › numpy › floor
Python Numpy floor() - Round Down Values | Vultr Docs
November 14, 2024 - Use the numpy.floor() function to round down all elements in the array. python Copy · import numpy as np array_floats = np.array([1.9, 2.6, 3.3, 4.8]) rounded_array = np.floor(array_floats) print(rounded_array) Explain Code · This code dynamically ...
🌐
LabEx
labex.io › tutorials › python-how-to-round-down-a-float-to-an-integer-in-python-415546
How to round down a float to an integer in Python | LabEx
When working with floating-point numbers in Python, you may sometimes need to convert them to integers. One common operation is to round down a float to the nearest integer, which is known as "floor" or "truncation" rounding.
🌐
TradingCode
tradingcode.net › python › math › round-decimals
How to round decimal places up and down in Python? • TradingCode
To round decimal places down we use a custom function. That turns 2.348 into 2.34. Let’s look at each approach and the Python code they require.
🌐
Mimo
mimo.org › glossary › python › round-function
Python round(): Rounding Numbers in Python
Using a negative value for the ndigits parameter, the round() function can round a floating-point number or integer to a multiple of 10. In the following example, we round 12345 to the nearest hundred (12300), simplifying the value. ... Python’s round() function works well in many cases.
🌐
The Teclado Blog
blog.teclado.com › rounding-in-python
Rounding in Python
October 26, 2022 - Okay, so the first thing to notice is that round, unlike ceil and floor provides the same result for positive and negative numbers, just with the opposite sign. There is something fishy going on, however. 2.5 rounded to 2 (rounding down), but 3.5 rounded to 4 (rounding up).
🌐
Hyperskill
hyperskill.org › university › python › rounding-and-round-in-python
Rounding and round() in Python
August 2, 2024 - If rounding to the whole number the round() function rounds up if the decimal part is 0.5 or greater and rounds down if its less, than 0.5. For instance rounding 3.2 using round(3.2) gives 3 as output; while rounding 3.5 returns 4 according to this function. The round() function, in Python ...
🌐
GeeksforGeeks
geeksforgeeks.org › python › how-to-round-numbers-in-python
How to Round Numbers in Python? - GeeksforGeeks
July 15, 2025 - Python’s built-in round() uses round half to even strategy, which rounds .5 to the nearest even number to minimize bias. If n is positive and d >= 5, round up · If n is positive and d = 5, round down ·
🌐
GeeksforGeeks
geeksforgeeks.org › python › round-function-python
round() function in Python - GeeksforGeeks
In the given example, round(-3.2) is converted into -3 is the nearest integer to -3.2. Similarly, round(-4.7) returns -5 since -5 is closer to -4.7 than -4. Similarly round(-2.5) returns -2 because it rounds down when the decimal part is exactly 0.5. Same as the fourth example demonstrates using the ndigits parameter with a negative number.
Published   August 7, 2024
🌐
Replit
replit.com › home › discover › how to round down in python
How to round down in Python
February 6, 2026 - The math.floor() function from Python's math module is your go-to for consistently rounding down. It returns the greatest integer that is less than or equal to the input number.