gcd

  • full name: tenpy.tools.math.gcd

  • parent module: tenpy.tools.math

  • type: function

tenpy.tools.math.gcd(a, b)[source]

Computes the greatest common divisor (GCD) of two numbers.

Return 0 if both a, b are zero, otherwise always return a non-negative number.