Skip to content

Instantly share code, notes, and snippets.

@avshabanov
Forked from abreslav/ratio.kt
Last active August 29, 2015 14:12
Show Gist options
  • Save avshabanov/5c03f1011b512e618e87 to your computer and use it in GitHub Desktop.
Save avshabanov/5c03f1011b512e618e87 to your computer and use it in GitHub Desktop.
class Ratio(num : Int, denom : Int) {
val numerator: Int
val denominator: Int
{
val theGcd = gcd(num, denom)
numerator = num / theGcd
denominator = denom / theGcd
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment