Java Number Power powerOfTen(int exp)

Here you can find the source of powerOfTen(int exp)

Description

power Of Ten

License

Open Source License

Declaration

private static long powerOfTen(int exp) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * This file is part of jasima, v1.3, the Java simulator for manufacturing and 
 * logistics./*from  w w w .  j a va2s.  c  o m*/
 *  
 * Copyright (c) 2015       jasima solutions UG
 * Copyright (c) 2010-2015 Torsten Hildebrandt and jasima contributors
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/

public class Main {
    private static long powerOfTen(int exp) {
        assert exp >= 0;

        long fact = 1;
        for (int i = 0; i < exp; i++) {
            fact *= 10;
        }
        return fact;
    }
}

Related

  1. powerOf(final int value, final int powerOf)
  2. powerOf10(int number)
  3. powerOf2Log2(int n)
  4. powerOf31(int n)
  5. powerOfN(Double v, int n)
  6. powerOfTwo(final int i)
  7. powerOfTwo(int current, int desired)
  8. PowerOutageDistr()
  9. powerString(int power)