In other programming languages (Ruby, C) and in Numbers and Excel spreadsheets
-1 % 10 => 9
In monkeyc
Sys.println (-1 % 10);
gives -1
Dave.
Former Member
If I remember correctly, I think C actually handles modulo the same as monkey-c and Ruby handles it differently. Regardless, the fact that monkey-c has chosen to handle modulo in this fashion doesn't mean that it is broken. You will find that there isn't a single uniform way all languages handle modulo with negative numbers.