AI engineering glossary · Python core
What is floor division?
Floor division: The // operator, which divides two numbers and rounds the result down to the nearest whole number toward negative infinity. It is used for tasks such as converting minutes to whole hours or splitting items into full batches.
Floor division: an example
135 // 60 gives 2 whole hours, and -7 // 2 gives -4, not -3, because it rounds down.
Related terms
More Python core terms
Where you learn it
Floor division is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.