0
Bitwise operator in reverse of an integer 123 to 321
If(result>integer.max_value/10 || result== integer.max_value/10 && A >7) return 0; Plz , can anyone help me with this? You see this code and method in this below YouTube link https://youtu.be/CRgXG1vK-wg
5 odpowiedzi
0
That's all doing reverse of an Integer..
If the resulted values going exceed the Integer range then it just returning 0.
result >= Integer.max_value/10 is there to check that just in next adding reminder will produce incorrect overflow result..
0
|| result== integer.max_value/10 && A >7) return 0;
0
Then what is the use of this
0
Integer Max value is 2147483647 and min value is -2147483648
So here look, last digit is 7,more than 7 and already result>=Integer.max_value/10 true then it cause overflow similar for next condition for - 8, min value.
I combined > and = to >=.
There are actually redundant checks..
0
Ok thq