We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Shafaet: I ve tryied to avoid the Math functions with this code but only It passed the first test.
In my eclipse after a big number it stop to read from the input:
Java Datatypes
You are viewing a single comment's thread. Return to all comments →
Shafaet: I ve tryied to avoid the Math functions with this code but only It passed the first test. In my eclipse after a big number it stop to read from the input:
long two_exp_31 = two_exp_15*two_exp_15*2; long two_exp_63_minus_one = two_exp_31*two_exp_31-1+two_exp_31*two_exp_31; if(x>=-(two_exp_15-1) && x<=(two_exp_15-1))System.out.println("* short"); if(x>=-(two_exp_31-1) && x<=(two_exp_31-1))System.out.println("* int"); if(x>=-(two_exp_63_minus_one) && x<=(two_exp_63_minus_one)) System.out.println("* long");
Could you give me an idea about the rest of the test cases?Thanks