When i run this code with a double it gives an error. An integer works fine what can be changed. :  import java.util.*; public class Gramsfunction { 	public static void main(String[] args) { 		System.out.println("Input for t for A(t)=1500(1/2)^t/14"); 		Scanner sc= new Scanner(System.in); 		double t = sc.nextInt(); 		double a = 1500; 		double b = 0.5; 		double c = 2; 		double d = 14 ; 		double e = t /2; 		double f = 14/2; 		double g = e / f; 		double h = c * g; 	 	 	double  i = a / d ; 	double j = c / d; 	double k = a / ( 15 / 7); 	 	double m = Math.pow(c , g); 	double n = Math.ceil( a / m); 	 	System.out.println("The total answer is " + n + "  rounded to the nearest" 			+ " tenth gram after " + t + " hours"); 	System.out.println("The exponent * 2 is " +m); 	System.out.println(g);  	} }