OpenRA/OpenRA — pull request #5767 by pchote (2014-06-28 03:59:38+00:00)
Title: Add Exts.ISqrt to avoid fp sqrt calculations.

This is based on the code from #5666, but extended/rewritten to cover all the cases we care about (not just CVec).

I spent some time trying to understand the algorithm, and now understand the key points, but I lose the plot when translating from decimal to binary. See http://www.embedded.com/electronics-blogs/programmer-s-toolbox/4219659/Integer-Square-Roots for some more details.

See http://pastebin.com/QGfk0be1 for a brute-force test-case for the entire int/uint range.