Answers for "math .floor java"

1

java math.floor example

import java.lang.*;

public class Math {

   public static void main(String[] args) {

      // get two double numbers
      double x = 60984.1;
      double y = -497.99;
   
      // call floor and print the result
      System.out.println("Math.floor(" + x + ")=" + Math.floor(x));
      System.out.println("Math.floor(" + y + ")=" + Math.floor(y));
      System.out.println("Math.floor(0)=" + Math.floor(0));
   }
}
Let us compile and run the above program, this will produce the following result −

Math.floor(60984.1)=60984.0
Math.floor(-497.99)=-498.0
Math.floor(0)=0.0
Posted by: Guest on June-20-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language