RosettaCodeData/Task/Nth-root/Dart/nth-root.dart

12 lines
204 B
Dart
Raw Permalink Normal View History

2023-12-16 21:33:55 -08:00
import 'dart:math' show pow;
num nroot(num value, num degree) {
return pow(value, (1 / degree));
}
void main() {
int n = 15;
num x = pow(-3.14159, 15);
print('root($n, $x) = ${nroot(n, x)}');
}