Skip to content

Latest commit

 

History

History
11 lines (10 loc) · 306 Bytes

File metadata and controls

11 lines (10 loc) · 306 Bytes
// P33 (*) Determine whether two positive integer numbers are coprime.
//     Two numbers are coprime if their greatest common divisor equals 1.
//
//     scala> 35.isCoprimeTo(64)
//     res0: Boolean = true

class S99Int(val start: Int) {
  def isCoprimeTo(n: Int): Boolean = gcd(start, n) == 1
}