Returns the largest integer less than or equal to the specified double.
- d
- A double .
A double containing the value of the largest integer less than or equal to d. If d is equal to double.NaN, double.NegativeInfinity, or double.PositiveInfinity, that value is returned..
The behavior of this method follows IEEE Standard 754, section 4.
The following example demonstrates using the Math.Floor(double) method.
C# Example
using System; public class MathFloorExample { public static void Main() { Double d1 = Math.Floor(3.4); Double d2 = Math.Floor(-3.4); Console.WriteLine("Math.Floor(3.4) returns {0}", d1); Console.WriteLine("Math.Floor(-3.4) returns {0}", d2); } }The output is
Math.Floor(3.4) returns 3
Math.Floor(-3.4) returns -4
Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0