Created
March 11, 2021 02:03
-
-
Save emmettna/702d972126d381dcceb8d8122ba7893c to your computer and use it in GitHub Desktop.
greaest common divisor in scala using java math
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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