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.
Ri-naround ang [code]s[/code] pababa (patungo sa negatibong walang hanggan) at ibinabalik ang pinakamalaking integer na hindi hihigit sa [code]s[/code]. [codeblock] a = floor(2.99) # katumbas ng 2.0 a = floor(-2.99) # katumbas ng 2.0 a = floor(-2.99) # katumbas ng -3.0 [/codeblock] [b] Tandaan: [/b] Ang method na 'to ay nagbabalik ng float. Kung kailangan mo ng integer at kung [code]s[/code] ay hindi negative, maaari mong direktang gamitin ang [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 = floor(2.99) # katumbas ng 2.0
a = floor(-2.99) # katumbas ng 2.0
a = floor(-2.99) # katumbas ng -3.0
[/codeblock]
[b] Tandaan: [/b] Ang method na 'to ay nagbabalik ng float. Kung kailangan mo ng integer at kung [code]s[/code] ay hindi negative, maaari mong direktang gamitin ang [code]int(s)[/code].