Logo

Programming-Idioms

History of Idiom 74 > diff from v31 to v32

Edit summary for version 32 by Jak Drako:
[VB] Typo in comment

Version 31

2019-09-30, 12:13:07

Version 32

2019-09-30, 12:13:30

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
Imports
Imports System.Numerics
Code
Dim x = BigInteger.GreatestCommonDivisor(a, b)	
Code
Dim x = BigInteger.GreatestCommonDivisor(a, b)	
Comments bubble
The BigInteger type from System.Numerics has a GreatestCommonDivison method built in.
Comments bubble
The BigInteger type from System.Numerics has a GreatestCommonDivisor method built in.