by John on (#6HH1H)
Given an integer n, suppose you want to compute n, the greatest integer less than or equal to the square root of n. One reason you may want to compute n is to know when you can stop trial division when factoring n. Similarly, n gives you a starting point for Fermat's factorization algorithm. With [...]The post Computing square root floor first appeared on John D. Cook.