It's just basic maths. The cube root of 27 is 27**(1/3). If you really want a function, try
print wop( 8, 3 ); #2 print wop( 27, 3 ); #3 sub wop { my ( $base, $root ) = @_; return $base ** (1/$root) }
update: s/If/If you/
In reply to Re: root function
by FunkyMonk
in thread root function
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |