By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,805 Members | 1,270 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,805 IT Pros & Developers. It's quick & easy.

Small doubt

P: 2
The expression x=4+2 % -8 evaluates to 6!!! How?
Feb 11 '17 #1
Share this Question
Share on Google+
1 Reply


weaknessforcats
Expert Mod 5K+
P: 9,197
It's 4+2 which is 6 then 6 % -8 which is 6.

BTW: the - is ignored. modulo numbers have no sign.
Feb 11 '17 #2

Post your reply

Sign in to post your reply or Sign up for a free account.