[Nickle] Nickle bug: hangs computing exponent
bart at cs.pdx.edu
Sun Sep 14 01:17:28 PDT 2003
I suspect this may not actually be a bug, but just a bad
algorithm leading to a too-long computation. At any rate:
hangs. Coercing the base to real (using imprecise()) makes
it complete quickly with a good answer. In fact, as one
scales the exponent, the time steadily increases.
Suggestion: does it make sense to compute the exponent of
the numerator and denominator separately, and then do a big
division and single GCD at the end? Let's try:
> qn = numerator(1-q)
> qd = denominator(1-q)
> qx = qn**10000;
> qy = qd**10000;
> qx / qy
hangs. Ahh, but
> qz = qx / qy;
returns instantly, so the problem is in output somewhere.
I note that
hangs, and tracing down it looks like the problem is likely
to be somewhere in RationalDecimalPrint () in rational.c.
Out of time to investigate tonight. Keithp?
P.S. During the investigation, another bug :-). The
prettyprinter should qualify names with namespace names
when the namespace is out of scope.
void func(string format, args ...)
vprintf (format, args);
<stdin>:5: No visible symbol "vprintf" in scope
> import File;
void func(string format, poly[*] args)
vfprintf (stdout, format, args);
More information about the Nickle