99 questions/Solutions/33

From HaskellWiki
< 99 questions‎ | Solutions
Revision as of 16:52, 13 July 2010 by Wapcaplet (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

(*) Determine whether two positive integer numbers are coprime. Two numbers are coprime if their greatest common divisor equals 1.

coprime a b = gcd a b == 1

Here we use the prelude function for computing gcd's along with a test of the result's equality to one.