Square root of positive real numbers
ALGORITHM The square root of a positive real number N can be computed with Newton's formula: New=0.5*(X+N/X)
where X above starts with a "reasonable" guess, e.g. (1+N)/2. It computes the square root until the absolute value of difference of two adjacent guess values is less than the tolerance value. Newton's iteration algorithm converges quadratically to the root.
IMPLEMENTATION
Unit:
internal function, external function without procedure statement
Parameters: a positive real number N>0, a positive integer P  number of significant digits of SQRT(N), default is 9 Returns: the first P significant digits of SQRT(N)
EXAMPLE
The following program
displays on the screen
CONNECTIONS
Euler's constant gamma
Euler's number e Number Pi Natural logarithms P+n trick by Walter Pachl in Reflexio
