Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: root function

by FunkyMonk (Chancellor)
on Jun 21, 2008 at 18:33 UTC ( [id://693295]=note: print w/replies, xml ) Need Help??


in reply to root function

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/


Unless I state otherwise, all my code runs with strict and warnings

Replies are listed 'Best First'.
Re^2: root function
by hobbs (Monk) on Jun 24, 2008 at 00:53 UTC
    You're going to have to rename that function "whop" for a US audience. :)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://693295]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2024-04-26 08:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found