Cool Bugs

Cool Bugs

Clock Arithmetic Still Hard

By | 2010-03-16T14:02:50+01:00 March 16th, 2010|Categories: Cool Bugs|

Clock or modular arithmetic is hard. Take a look at the two code snippets below. Both seem reasonable integer comparison functions modeled after strcmp(). However, the left one contains an [...]