/usr/share/doc/hp48cc/examples/gcd.hpc is in hp48cc 1.3-5.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | // gcd.hpc -- Finds greatest common denominators -*- C -*-
//
// Based on a version written by Jay Kominek <jkominek@debian.org>
declare gcd(m, n) : z(0) {
if (n > m) { // Swap values
z = m;
m = n;
n = z;
}
do {
z = m % n;
m = n;
n = z;
} while (z != 0);
m; // Return value
}
|