Java Number Power pow10(int n)

Here you can find the source of pow10(int n)

Description

pow

License

Open Source License

Declaration

public static double pow10(int n) 

Method Source Code

//package com.java2s;
// This software is licensed under the GNU General Public License,

public class Main {
    public static double pow10(int n) {
        if (n == 0)
            return 1;
        else if (n > 0) {
            double d = 1;
            for (int i = 0; i < n; i++)
                d = d * 10.;//w w w.  jav  a  2 s.  co  m
            return d;
        } else {
            double d = 1;
            for (int i = 0; i > n; i--)
                d = d / 10.;
            return d;
        }
    }
}

Related

  1. pow(long value, long pow)
  2. pow(Number x, Number exponent)
  3. pow(String str, int n)
  4. pow10(final int exponent)
  5. pow10(int degree)
  6. pow16(float a)
  7. pow2(double base, double power)
  8. pow2(double num)
  9. pow2(double x, int n)