Skip to content

Instantly share code, notes, and snippets.

@abreslav
Created November 11, 2014 09:12
Show Gist options
  • Save abreslav/173c32a30f9f94e1cd9a to your computer and use it in GitHub Desktop.
Save abreslav/173c32a30f9f94e1cd9a 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