PHP 8.5.0 Beta 1 available for testing

Voting

: six plus zero?
(Example: nine)

The Note You're Voting On

me at abiusx dot com
5 years ago
function gcd($a,$b)
{
return $b ? gcd($b, $a%$b) : $a;
}

This is pretty fast and short, also easy to remember. If $b is zero, return a, otherwise swap and mod.

<< Back to user notes page

To Top