17 static int gcd(int x, int y)
22 while (y) { t = x%y; x = y; y = t; }
27 [nick = rat, link = SodObject]
28 class Rational: SodObject {
30 initarg int num = 0, den = 1;
39 void print(FILE *fp) { fprintf(fp, "%d/%d\n", me->rat.num, me->rat.den); }
45 SOD_DECL(Rational, r0, KWARGS(K(den, 9)));
46 SOD_DECL(Rational, r1, KWARGS(K(num, 6)));
47 SOD_DECL(Rational, r2, KWARGS(K(num, 6) K(den, 9)));
48 Rational_print(r0, stdout);
49 Rational_print(r1, stdout);
50 Rational_print(r2, stdout);