by Denvercoder9 · 5y ago · 0 comments
https://ridiculousfish.com/blog/posts/labor-of-division-epis...
https://ridiculousfish.com/blog/posts/labor-of-division-epis...
And it's faster if and only if you're repeating division by a single number since you're still doing the equivalent of divide to get the invest (but repeated division is actually quite common so this is useful).
This is done at compile-time by the compiler. We're talking about division by a constant, not by a variable. So it's always faster.