Welcome! Please see the About page for a little more info on how this works.
gcd calls mod. The code already guarantees that the both arguments are positive so in this case, rem could be used instead to get the same result, but with a slight performance improvement.
gcd
mod
rem