Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> I've seen simple cases where a function returned a signed integer value modulo x. Which of course means that this function can only return a value within 0..x-1.

Actually, signed modulo can return negative numbers... See, for example, this StackOverflow question:

http://stackoverflow.com/questions/7594508/modulo-operator-w...



Ha, good catch. But in this case x was always positive.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: