3 ms·
I always assumed that CPUs used Newton's method, though that could be wrong. https://en.wikipedia.org/wiki/Division_algorithm#Newton%E2%80%93Raphson_division ht
by pcwalton 5y ago
I always assumed that CPUs used Newton's method, though that could be wrong. https://en.wikipedia.org/wiki/Division_algorithm#Newton%E2%80%93Raphson_division https://en.wikipedia.org/wiki/Division_algorithm#Newton%E2%8...
Edit: Yeah, that's only used for floating point. Looks like integer division is usually an algorithm called SRT: https://en.wikipedia.org/wiki/Division_algorithm#SRT_division https://en.wikipedia.org/wiki/Division_algorithm#SRT_divisio...
- stephencanon 5y agoThere are multiple choices used by different implementors. Quadratically convergent iterations like Newton-Raphson and Goldschmidt, and digit-by-digit algorithms like SRT are all common choices represented in mainstream hardware designs and software libraries (for both floating-point and integer).