![]() |
|
Navigation |
Synopsis Calculate the nth root of a numeric value.
Function
real nroot(num x, int n)
Usage
import util::Math;
Description Calculate n√
x where n can only be a integer.
Examples
rascal>import util::Math; ok rascal>nroot(42 * 42, 2); real: 42.00000000000 rascal>nroot(42 * 42 * 42, 3); real: 42.00000000000 rascal>nroot(123456789012345678901234567890123456789.0, 100) real: 2.40389309382 ![]() |