Skip to main content

floor

Function floor 

pub fn floor(x: &Variant) -> Variant
Expand description

Rounds x downward (towards negative infinity), returning the largest whole number that is not more than x. Supported types: int, float, Vector2, Vector2i, Vector3, Vector3i, Vector4, Vector4i.

var a = floor(2.99) # a is 2.0
a = floor(-2.99)    # a is -3.0

See also [method ceil], [method round], and [method snapped].

Note: For better type safety, use [method floorf], [method floori], floor, floor, or floor.