You are viewing a single comment's thread. Return to all comments →
Hey Kucao, I had the same solution as yours, with just this minor change, and I got it wrong. Not able to understand why. Can someone explain ?
if(x >= (short)-Math.pow(2, 15) && x <=(short) Math.pow(2, 15) - 1) System.out.println("* short"); if(x >= (int)-Math.pow(2, 31) && x <=(int) Math.pow(2, 31) - 1) System.out.println("* int"); if(x >= (long)-Math.pow(2, 63) && x <=(long) Math.pow(2, 63) - 1) System.out.println("* long");
Seems like cookies are disabled on this browser, please enable them to open this website
Java Datatypes
You are viewing a single comment's thread. Return to all comments →
Hey Kucao, I had the same solution as yours, with just this minor change, and I got it wrong. Not able to understand why. Can someone explain ?