Java floor floor(double num, int bit)

Here you can find the source of floor(double num, int bit)

Description

floor

License

Open Source License

Declaration

public static double floor(double num, int bit) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static double floor(double num, int bit) {
        int t = 1;
        for (int i = 0; i < bit; i++)
            t *= 10;// w  w w . j  a va 2  s  . co m
        int n = (int) (num * t);
        return (double) n / t;
    }

    public static double floor(double num) {
        return floor(num, 0);
    }
}

Related

  1. floor(double d)
  2. floor(double d)
  3. floor(double d, int exp)
  4. floor(double d, int p)
  5. floor(double num)
  6. floor(double number, int decimals)
  7. floor(double value, int decimal)
  8. floor(double value, int scale)
  9. floor(double var0)