java - Remainder operator gives negative result -


i have problem remainder operator in java: why this:

(int)2147483648l % 10 

gives negative number (-8)?

that's because (int) 2147483648l -2147483648. you're casting long int , out of bounds.


Comments

Popular posts from this blog

Change php variable from jquery value using ajax (same page) -

How can I fetch data from a web server in an android application? -

jquery - How can I dynamically add a browser tab? -