Rounds [code]s[/code] downward (towards negative infinity), returning the largest whole number that is not more than [code]s[/code]. [codeblock] a = floor(2.45)# a is 2.0 a = floor(2.99)# a is 2.0 a = floor(-2.99) # a is -3.0 [/codeblock] See also [method ceil], [method round], [method stepify], and [int]. [b]Note:[/b] This method returns a float. If you need an integer and [code]s[/code] is a non-negative number, you can use [code]int(s)[/code] directly.
Zaokrouhlí [code] s [/code] dolů (směrem k zápornému nekonečnu) a vrátí největší celé číslo, které není větší než [code] s [/code]. [codeblock] # a je 2,0 a = floor(2,99) # a je -3,0 a = floor(-2,99) [/ codeblock] [b] Poznámka: [/b] Tato metoda vrací float. Pokud potřebujete celé číslo, můžete použít přímo [code] int (s) [/code].
[codeblock]
a = floor(2.45) # a is 2.0
a = floor(2.99) # a is 2.0
a = floor(-2.99) # a is -3.0
[/codeblock]
See also [method ceil], [method round], [method stepify], and [int].
[b]Note:[/b] This method returns a float. If you need an integer and [code]s[/code] is a non-negative number, you can use [code]int(s)[/code] directly.
[codeblock]
# a je 2,0
a = floor(2,99)
# a je -3,0
a = floor(-2,99)
[/ codeblock]
[b] Poznámka: [/b] Tato metoda vrací float. Pokud potřebujete celé číslo, můžete použít přímo [code] int (s) [/code].