You are viewing a single comment's thread. Return to all comments →
if(x >= -Math.pow(2, 63) && x <= Math.pow(2, 63) - 1) this particular condition checking isnt required at all.
According to problem statement the long data type can fit in all possibe input except when it doesnt. So the initialization and assignment part
long x=sc.nextLong(); along with the try and catch exception checking and handling blocks take care of that.
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 →
According to problem statement the long data type can fit in all possibe input except when it doesnt. So the initialization and assignment part