A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.w3schools.com/python/ref_math_floor.asp below:

Website Navigation


Python math.floor() Method

Python math.floor() Method

❮ Math Methods

Example

Round numbers down to the nearest integer:

# Import math library

import math

# Round numbers down to the nearest integer

print(math.floor(0.6))

print(math.floor(1.4))

print(math.floor(5.3))

print(math.floor(-5.3))

print(math.floor(22.6))

print(math.floor(10.0))

Try it Yourself » Definition and Usage

The math.floor() method rounds a number DOWN to the nearest integer, if necessary, and returns the result.

Tip: To round a number UP to the nearest integer, look at the math.ceil() method.

Syntax Parameter Values Parameter Description x Required. Specifies the number to round down Technical Details Return Value: An int value, representing the rounded number Change Log: Python 3+ : Returns an int value
Python 2.x : Returns a float value

❮ Math Methods

Track your progress - it's free!


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4