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

For things that wrap, such as ring buffer indices or packet sequence numbers in a fixed-size field or clocks (hour of the day, minutes in an hour), zero-based indexing is simple modular arithmetic. Wrapping of one-based indices can of course be done, but it's more complicated than necessary.


On the other hand, actual clocks have a 12 on them.




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

Search: