Description
The FloorToInt
method in the MathX
class is a static method that converts a floating-point number to the largest integer less than or equal to the specified number. This method is useful when you need to round down a floating-point number to the nearest integer.
Usage
To use the FloorToInt
method, simply call it with a single float
parameter. The method will return an int
representing the largest integer less than or equal to the input value.
Example
// Example usage of MathX.FloorToInt
float value = 3.7f;
int flooredValue = MathX.FloorToInt(value);
// flooredValue will be 3