Programming-Idioms

History of Idiom 74 > diff from v30 to v31

Edit summary for version 31 :
New VB implementation by user [Jak Drako]

Version 30

2019-09-28, 16:19:58

Version 31

2019-09-30, 12:13:07

Idiom #74 Compute GCD

Compute the greatest common divisor x of big integers a and b. Use an integer type able to handle huge numbers.

Idiom #74 Compute GCD

Compute the greatest common divisor x of big integers a and b. Use an integer type able to handle huge numbers.

Imports
Imports System.Numerics
Code
Dim x = BigInteger.GreatestCommonDivisor(a, b)	
Comments bubble
The BigInteger type from System.Numerics has a GreatestCommonDivison method built in.