gcd#
- class brainunit.math.gcd(x1, x2, **kwargs)#
Return the greatest common divisor of x1 and x2.
- Parameters:
- Returns:
out – Quantity if x1 and x2 are Quantities that have the same unit, else an array.
- Return type:
saiunit.Quantity |
Array
Examples
>>> import saiunit as u >>> import jax.numpy as jnp >>> a = jnp.array([4, 6]) * u.second >>> b = jnp.array([6, 8]) * u.second >>> u.math.gcd(a.astype(jnp.int64), b.astype(jnp.int64))