Chapter 11. Some Elementary Functions

11–1 Integer Square Root

By the “integer square root” function, we mean the function Image. To extend its range of application and to avoid deciding what to do with a negative argument, we assume x is unsigned. Thus, 0 ≤ x ≤ 232 – 1.

Newton’s Method

For floating-point numbers, the square root is almost universally computed by Newton’s method. This method begins by somehow obtaining a starting estimate g0 of Image. Then, a series of more accurate estimates is obtained from

The iteration converges quadratically—that is, ...

Get Hacker’s Delight, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.