Simple $root

By LIQUID_NiTrO on Mar 21, 2005

This is my most basic alias I've ever posted here, just returns the x-root of a number.
I know you can do it with $calc, but doing that is a little complicated and for some of us math idiots confusing, so this is just to make life a little easier.
Syntax is $root(number,root)
Example: $root(125,3) --- returns 5, because 53=125

alias root {
  if ( !$1 ) || ( !$2 ) || ( $1 !isnum ) || ( $2 !isnum ) {
    $iif($isid,return ERR_PARAMS,echo $colour(info) -a * Syntax: /root <number> <root>
  }
  $iif($isid,return $calc($1 ^ (1 / $2)),echo $colour(info) -a * $calc($1 ^ (1 / $2)))
}

Comments

Sign in to comment.
LIQUID_NiTrO   -  Dec 03, 2006

That is basically what I use...i think you got mixed up or something though cause $calc($1 ^ $2) would return $1 to the $2 power, which is the opposite purpose of this snippet, thus i reciprocate $2 by doing $calc($1 ^ (1/ $2))

 Respond  
DarthReven   -  Apr 20, 2005

you could just use $calc($1 ^ $2)

 Respond  
supergeo   -  Mar 22, 2005

oops I bumped enter too soon. Let me try that again ;) Ya know that is actually a really nice snippet which has a practical use and I really like your thinking up a different snippet not just another couple of away systems which can only change so much. Nice job Liquid I give you a 9

 Respond  
supergeo   -  Mar 22, 2005

Ya know that\'

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.