Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- alias gcd {
- var %a $1, %b $2
- while (%b != 0) {
- var %t %b
- %b = $calc(%a % %b)
- %a = %t
- }
- return %a
- }
- alias _lcm {
- return $calc($1 * $2 / $gcd($1, $2))
- }
- alias LCM {
- tokenize 32 $1-
- if $0 >= 2 {
- return $LCMA($_lcm($1,$2) $3-)
- }
- else {
- return $1
- }
- }
- alias LCMA {
- tokenize 32 $1-
- if $0 >= 2 {
- return $LCMB($_lcm($1,$2) $3-)
- }
- else {
- return $1
- }
- }
- alias LCMB {
- tokenize 32 $1-
- if $0 >= 2 {
- return $LCMA($_lcm($1,$2) $3-)
- }
- else {
- return $1
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement