title: Making a power with an double base and an integer exponent without any math. library in Java
body: <p>I need to make a power of a double base with an integer exponent without     using any <code>math.</code> library but I get the error: </p>
  
  <pre><code>package potencia;
  
  import java.util.Scanner;
  
  public class Potencia {
  int n=0;
  double b=0,p=0, potencia=1;
  Scanner entrada= new Scanner(System.in);
  
  public static void main(String[] args) {
      int n=0;
      double b=0,p=0, potencia=1;
      Scanner entrada= new Scanner(System.in);
  
      System.out.println("Por favor ingrese la base de su potencia: ");
      b=entrada.nextDouble();
  
      System.out.println("Por favor ingrese el exponente de su     potencia");
      n=entrada.nextInt();
      for (int i=0; i&lt;n; i++){
          potencia= potencia*b;
          }
      System.out.println("La potencia "+n+" de "+b+ " es: "+potencia);  
  
      }
  </code></pre>
  
  <p>Error:</p>
  
  <blockquote>
    <p>Exception in thread "main" java.util.InputMismatchException at
    java.util.Scanner.throwFor(Scanner.java:864) at
    java.util.Scanner.next(Scanner.java:1485) at
    java.util.Scanner.nextFloat(Scanner.java:2345) at
    potencia.Potencia.main(Potencia.java:20) Java returned: 1</p>
  </blockquote>