java_gurl
asked on
nth root in Perl?
Hi,
I want to get the nth root of a number in perl. I know the squared root function exists but i need to perform an operation that requires the nth root.
thanks
java gurl
*the girl of your dreams*
I want to get the nth root of a number in perl. I know the squared root function exists but i need to perform an operation that requires the nth root.
thanks
java gurl
*the girl of your dreams*
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks a million!
--------------------------
#!/usr/bin/perl
my $number=8;
my $nth_root=3;
$log_e = log($number);
$answer=exp ($log_e/$nth_root);
print "$nth_root th root of $number is $answer\n";
--------------------------