Java Utililty Methods floor

List of utility methods to do floor

Description

The list of methods to do floor are organized into topic(s).

Method

doublefloor(double num, int bit)
floor
int t = 1;
for (int i = 0; i < bit; i++)
    t *= 10;
int n = (int) (num * t);
return (double) n / t;
doublefloor(double number, int decimals)
Returns the floor number to the given decimal places.
double pow = number * Math.pow(10, decimals);
double floor = Math.floor(pow);
double value = floor / Math.pow(10, decimals);
return value;
doublefloor(double value, int decimal)
Rounds the passed value to the specified number of decimals.
if (decimal <= 0)
    return value;
double p = Math.pow(10, decimal);
value = value * p;
return Math.floor(value) / p;
doublefloor(double value, int scale)
Floor.
double power = Math.pow(10, scale);
return Math.floor(value * power) / power;
intfloor(double var0)
floor
int var2 = (int) var0;
return var0 < (double) var2 ? var2 - 1 : var2;
intfloor(double x)
floor
int y = (int) x;
if (x < y) {
    return y - 1;
return y;
intfloor(double x)
Rounds x down to the closest integer
int y = (int) x;
if (x < y) {
    return y - 1;
return y;
intfloor(double x)
A fast implementation of Math#floor(double) .
return (int) (x + BIG_ENOUGH_FLOOR) - BIG_ENOUGH_INT;
doublefloor(double x, double y)
Truncate x down to the nearest y.
return y * Math.floor((x + .00001) / y);
double[]floor(double[] array)
Rounds down each element of a given double array.
double[] out = new double[array.length];
for (int i = 0; i < array.length; i++)
    out[i] = Math.floor(array[i]);
return out;