C# Math Floor(Double)
Description
Math Floor(Double)
returns the largest integer less
than or equal to the specified double-precision floating-point number.
Syntax
Math.Floor(Double)
has the following syntax.
public static double Floor(
double d
)
Parameters
Math.Floor(Double)
has the following parameters.
d
- A double-precision floating-point number.
Returns
Math.Floor(Double)
method returns The largest integer less than or equal to d. If d is equal to NaN, NegativeInfinity,
or PositiveInfinity, that value is returned.
Example
The following example illustrates the Math.Floor(Double) method and contrasts it with the Ceiling(Double) method.
using System;/*from ww w.ja va 2 s .c o m*/
public class MainClass{
public static void Main(String[] argv){
Console.WriteLine(Math.Floor(1.2));
}
}
The code above generates the following result.