Factorial Finder [70 B]

By Vegito on Dec 06, 2013

Type //echo -a $factorial(nr) to get the factorial of the specified number.

alias factorial {
  var %n 1,%i $1
  while %i {
    %n = %n * %i 
    dec %i 
  }
  return %n
}   

Comments

Sign in to comment.
SReject   -  Jan 13, 2014
alias factorial { return $calc($regsubex($str(.,$1),/./g,\n *) 1)  }
 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.