Imk0tter commented on a Page, Least Common Multiple  -  May 28, 2011

to enhance jaytea's post:

each work with a dynamic number of parameters

alias gcd {
  while $2 {
    while $2 {
      tokenize 32 $2 $calc($1 % $2) $3-
    }
    tokenize 32 $1 $3-
  }
  return $1
}
alias lcm {
  while $2 {
    tokenize 32 $calc($1 * $2 / $gcd($1, $2)) $3-
  }
  return $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.