Created
February 8, 2014 15:27
-
-
Save aNNiMON/8885445 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private int julery_isqrt(int val) { | |
int temp, g = 0, b = 0x8000, bshft = 15; | |
do { | |
if (val >= (temp = (((g << 1) + b) << bshft--))) { | |
g += b; | |
val -= temp; | |
} | |
} while ((b >>= 1) > 0); | |
return g; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment