Skip to content

Instantly share code, notes, and snippets.

@emmettna
Created March 11, 2021 02:03
Show Gist options
  • Save emmettna/702d972126d381dcceb8d8122ba7893c to your computer and use it in GitHub Desktop.
Save emmettna/702d972126d381dcceb8d8122ba7893c to your computer and use it in GitHub Desktop.
greaest common divisor in scala using java math
import java.math.BigInteger
def gcd(left: Long, right: Long): Long = BigInteger.valueOf(left).gcd(BigInteger.valueOf(right)).longValue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment