Java StrictMath.floor(double a)

Syntax

StrictMath.floor(double a) has the following syntax.

public static double floor(double a)

Example

In the following code shows how to use StrictMath.floor(double a) method.


// w  w  w  .jav a 2  s .c  o  m
public class Main {

  public static void main(String[] args) {
  
    double d1 = 5.3 , d2 = 7.8, d3 = 1.5;

    System.out.println("Floor value of " + d1 + " = " + StrictMath.floor(d1));
     
    System.out.println("Floor value of " + d2 + " = " + StrictMath.floor(d2));
    
    System.out.println("Floor value of " + d3 + " = " + StrictMath.floor(d3));
  }
}

The code above generates the following result.





















Home »
  Java Tutorial »
    java.lang »




Boolean
Byte
Character
Class
Double
Enum
Float
Integer
Long
Math
Number
Object
Package
Process
ProcessBuilder
Runnable
Runtime
SecurityManager
Short
StackTraceElement
StrictMath
String
StringBuffer
StringBuilder
System
Thread
ThreadGroup
ThreadLocal
Throwable