Java Ceil ceil(double num, int bit)

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

Description

ceil

License

Open Source License

Declaration

public static double ceil(double num, int bit) 

Method Source Code

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

public class Main {
    public static double ceil(double num, int bit) {
        int t = 1;
        for (int i = 0; i < bit; i++)
            t *= 10;//from   ww  w  . j a  v a2 s  . c  om
        int n = (int) (num * t) + 1;
        return (double) n / t;
    }

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

Related

  1. ceil(double d)
  2. ceil(double d)
  3. ceil(double d, int exp)
  4. ceil(double d, int p)
  5. ceil(double double1, double double2)
  6. ceil(double value, int decimal)
  7. ceil(double value, int scale)
  8. ceil(double Var1)
  9. ceil(double x)