Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
The power of two – fast division and modulo operations (teamleadnet.com)
2 points by liamswayne on April 25, 2024 | hide | past | favorite | 1 comment


Better: https://libdivide.com/. That also optimizes division by non-powers of two.

https://ridiculousfish.com/blog/posts/labor-of-division-epis... explains the math behind it.




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

Search: