Integer square root
[Click here for a PDF of this post with nicer formatting]
In [1] is a rather mysterious looking constant expression formula for an integer square root. This is a function that returns the smallest integer for which the square is less than the value to take the root of. Check out the black magic he used
// Stroustrup 10.4: constexpr capable integer square root function constexpr int…
View On WordPress

















