4 ms·
I just want to point out one of the links on that page: http://en.wikipedia.org/wiki/Fast_inverse_square_root http://en.wikipedia.org/wiki/Fast_inverse_square_r
by Nav_Panel 14y ago
I just want to point out one of the links on that page: http://en.wikipedia.org/wiki/Fast_inverse_square_root http://en.wikipedia.org/wiki/Fast_inverse_square_root
Absolutely hilarious and amazingly magical method of algorithmically computing square roots. It right shifts a floating point number to essentially divide the exponent component by 2. Then it uses a weird magic number trick to get the correct result. Awesome random programming trivia.
- ars 14y agoNote that this is the inverse square root, i.e. 1/sqrt(x) (which can also be written x^(-1/2) ).