Java floor floor(double d)

Here you can find the source of floor(double d)

Description

Unchecked implementation to round a number down.

License

LGPL

Declaration

public static int floor(double d) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

public class Main {
    /**//from  www  . ja  va2s .  c  om
     * Unchecked implementation to round a number down. Parameter should be known to be valid in advance.
     */
    public static int floor(double d) {
        int i = (int) d;
        return d < i ? i - 1 : i;
    }
}

Related

  1. floor(double a)
  2. floor(double a, double precision)
  3. floor(double a, int cutOfDigits)
  4. floor(double a, int n)
  5. floor(double d)
  6. floor(double d)
  7. floor(double d, int exp)
  8. floor(double d, int p)
  9. floor(double num)