Implement gcd and lcm in scheme

Issue #81 new
Katie Burke created an issue

gcd should return the greatest common divisor of its arguments. lcm should return the least common multiple of its arguments. ( http://www.scheme.com/tspl4/objects.html#./objects:s109 )

This should return 14.

(gcd 70 -42 28)

Traceback (most recent call last):
File "stdin", line 1, col 2
RunTimeError: unbound variable 'gcd'

This should return 165.0

(lcm 33.0 15.0)

Traceback (most recent call last):
File "stdin", line 1, col 2
RunTimeError: unbound variable 'lcm'

Comments (1)

  1. Log in to comment