Integer roots: Difference between revisions

Content added Content deleted
m (→‎{{header|REXX}}: changed wording in the REXX section header.)
No edit summary
Line 2: Line 2:
'''Integer roots'''
'''Integer roots'''


The task is to write a program that computes the Nth root of X as the largest integer less than or equal to R for which R^N=X. N and X are both integers. R is a real number.
The task is to write a program that computes the Nth root of X as the largest integer less than or equal to R for which R^N=X. N is a positive integer. X is a non-negative integer. R is a real number.

As a test, you can calculate the first 2,001 digits in the decimal expansion of the square root of two. The method involves multiplying 2 by 100^2000 before taking the square root. You will then have the 2,001 most significant digits of the square root of two. Just remember where the decimal point goes and you are all set!


=={{header|Python}}==
=={{header|Python}}==