Logo

Programming-Idioms

History of Idiom 74 > diff from v22 to v23

Edit summary for version 23 by programming-idioms.org:
[PHP] Comments emphasis

Version 22

2018-08-22, 20:35:46

Version 23

2018-09-06, 20:03:38

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
extension=gmp
Imports
extension=gmp
Code
$x = gmp_gcd($a, $b);
Code
$x = gmp_gcd($a, $b);
Comments bubble
both $a and $b must be instances of the GMP class
Comments bubble
both $a and $b must be instances of the GMP class
Doc URL
https://secure.php.net/manual/en/function.gmp-gcd.php
Doc URL
https://secure.php.net/manual/en/function.gmp-gcd.php
Demo URL
https://3v4l.org/bHdmR
Demo URL
https://3v4l.org/bHdmR