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

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

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -