IntGCD
IntGCD
Description
Compute the greatest common divisor of two integers.
Parameters
| Name | Direction | Description |
|---|---|---|
result |
out | Destination for the GCD |
a |
in | First operand |
b |
in | Second operand |
Usage example (from documentation)
IntGCD(&gcd, &a, &b);Usage example (Cross-references)
Usage examples (Cross-references)
- In
Int.c:1118:
}
void IntGCD(Int *result, Int *a, Int *b) {
ValidateInt(result);
ValidateInt(a);- In
Int.c:1154:
Int lcm = IntInit();
IntGCD(&gcd, a, b);
IntDiv("ient, a, &gcd);
IntMul(&lcm, "ient, b);- In
Int.Math.c:419:
bool test_int_gcd(void) {
WriteFmt("Testing IntGCD\n");
Int a = IntFrom(48);- In
Int.Math.c:425:
Int result_value = IntInit();
IntGCD(&result_value, &a, &b);
bool result = IntToU64(&result_value) == 6;
Last updated on