Java Datatypes

  • + 3 comments

    Simply write your own 2^x function and use that instead of Math.pow which has an upper limit:

    public static long power(int x){
            long r = 1;
            for (int k=0;k<x;k++){
                r = r * 2;
            }
            return r;
    }