In Python 3.x, 5 / 2 will return 2.5 and 5 // 2 will return 2. The former is floating point division, and the latter is floor division, sometimes also called integer division.

In Python 2.2 or later in the 2.x line, there is no difference for integers unless you perform a from __future__ import division, which causes Python 2.x to adopt the 3.x behavior.

Regardless of the future import, 5.0 // 2 will return 2.0 since that's the floor division result of the operation.

You can find a detailed description at PEP 238: Changing the Division Operator.

Answer from Eli Courtwright on Stack Overflow
🌐
GeeksforGeeks
geeksforgeeks.org β€Ί python β€Ί floor-division-in-python
Floor Division in Python - GeeksforGeeks
July 23, 2025 - we are performing floor division ... decimal). If both the dividend and divisor are integers, Python will perform integer division if the result is an integer; otherwise, it will produce a floating-point result....
🌐
Python Reference
python-reference.readthedocs.io β€Ί en β€Ί latest β€Ί docs β€Ί operators β€Ί floor_division.html
// floor division β€” Python Reference (The Right Way) 0.1 documentation
// floor division Β· Edit on GitHub Β· Returns the integral part of the quotient. A // B Β· A Β· Any expression evaluating to a numeric type. B Β· Any expression evaluating to a numeric type. According to coercion rules. #TODO Β· Also referred to as integer division.
🌐
Python Tutorial
pythontutorial.net β€Ί home β€Ί advanced python β€Ί python floor division
Python Floor Division
March 27, 2025 - The integer division 101 / 4 returns 25 with the remainder 1. In other words: 101 / 4 = 25 with remainder 1Code language: plaintext (plaintext) ... The // is called the floor division operator or div.
🌐
OpenStax
openstax.org β€Ί books β€Ί introduction-python-programming β€Ί pages β€Ί 2-5-dividing-integers
2.5 Dividing integers - Introduction to Python Programming | OpenStax
March 13, 2024 - Ex: 7 / 4 becomes 7.0 / 4.0, resulting in 1.75. Floor division (//) computes the quotient, or the number of times divided. Ex: 7 // 4 is 1 because 4 goes into 7 one time, remainder 3. The modulo operator (%) computes the remainder.
🌐
YouTube
youtube.com β€Ί watch
Python Floor Division Operator vs Division (Tutorial with Examples) - YouTube
Learn how the floor division operator works in Python and why it is different from the division operator with this step-by-step tutorial and practical exampl...
Published Β  November 10, 2020
🌐
LearnDataSci
learndatasci.com β€Ί solutions β€Ί python-double-slash-operator-floor-division
Python Double Slash (//) Operator: Floor Division – LearnDataSci
The result of regular division is always a float, whereas if one of the operands is a float in floor division, then the output will be a float.
Find elsewhere
🌐
GeeksforGeeks
geeksforgeeks.org β€Ί python β€Ί division-operators-in-python
Division Operators in Python - GeeksforGeeks
Notice how even though 5 / 5 is ... output in float. It is also known as Floor division because, if any number is negative, then the output will be floored....
Published Β  September 17, 2025
🌐
Reddit
reddit.com β€Ί r/programminglanguages β€Ί why python's integer division floors
r/ProgrammingLanguages on Reddit: Why Python's Integer Division Floors
February 16, 2024 - Division using Banker's Rounding produces remainders using the least absolute/symmetric representatives. Finally flooring if the divisor is positive and taking the ceiling otherwise produces remainders using the least positive representation ...
🌐
Python
peps.python.org β€Ί pep-0238
PEP 238 – Changing the Division Operator | peps.python.org
For all other operators, one can ... But division poses a problem: if the expressions for both arguments happen to have an integral type, it implements floor division rather than true division....
🌐
Quora
quora.com β€Ί What-does-floor-division-in-Python-do
What does floor division ('//') in Python do? - Quora
Mixed types: result type follows Python numeric coercion (int//int β†’ int; anything with float β†’ float). ... Floor is toward negative infinity, not truncation toward zero. This causes negative dividends or divisors to round down (more negative).
🌐
Prospero Coder
prosperocoder.com β€Ί home β€Ί true division vs floor division in python
True Division vs Floor Division in Python - Prospero Coder
May 1, 2022 - In floor division the result is truncated down, so the result is the floor – the largest integer number smaller than the result of true division:
🌐
The Teclado Blog
blog.teclado.com β€Ί pythons-modulo-operator-and-floor-division
Python's modulo operator and floor division
October 26, 2022 - The amount left over after the ... to carry out Euclidean division, but unlike the modulo operator, floor division yields the quotient, not the remainder....
🌐
W3Schools
w3schools.com β€Ί python β€Ί python_operators_arithmetic.asp
Python Arithmetic Operators
Python has two division operators: / - Division (returns a float) // - Floor division (returns an integer) Division always returns a float: x = 12 y = 5 print(x / y) Try it Yourself Β» Β· Floor division always returns an integer.
🌐
Sololearn
sololearn.com β€Ί en β€Ί Discuss β€Ί 80314 β€Ί what-is-the-difference-between-floor-division-and-normal-division
what is the difference between floor division and normal division | Sololearn: Learn to code for FREE!
There is very basix difference Normal division gives floating point number and floor division gives whole number. see below example 24/12 = 2.0 not 2 # Floating Point Number 24 // 12 = 2 not 2.0 # Whole Number / - is normal division it will ...
🌐
Purple Engineer
purpletutor.com β€Ί home β€Ί understanding code β€Ί python floor division guide for precise integer results
Floor division python guide with examples for integer division πŸš€πŸ”
December 24, 2025 - Floor division is a fundamental arithmetic operator in Python that performs division and returns the largest integer less than or equal to the result. The operator uses double forward slashes (//) as its syntax, distinguishing it from regular ...
🌐
Codingem
codingem.com β€Ί home β€Ί python floor division β€” a complete guide to the // operator
Python Floor Division β€” A Complete Guide to the // Operator
April 10, 2023 - Let’s calculate these numbers ... 2 >>> nleftovers 1 Β· In Python, the floor division operator // has the same precedence level as multiplication (*), division (/), and modulo (%)....