-----Robert Dodier wrote: -----
> I propose that these be moved into maxima/src after testing.
I think this would be ok -- the only tricky part of this code
is the function that uses bfloat evaluation to find the floor
and ceiling of constant expressions. I encourage everybody
to try to break this code. Also, if you have better ideas or
references, let me know. [My code is supposed to give up
and return a noun form when it's too close to call. For
ill-conditioned expressions, it's possible the floor and
ceiling could evaluate incorrectly.]
>There already exists a function compare in
>src/compar.lisp which is somewhat similar. compare is never
>called from anywhere in src/, test/, or share/, so far as I
>can tell, and it is undocumented. So I think it is safe to cut the
>existing compare and replace it with the nummod version.
I agree. I can not find any references to 'compare' either.
The current 'compare' function is too confusing for
me to use:
(%i3) compare(5,6);
(%o3) NEG <--- huh? what does this mean?
(%i4) load("C:/maxima/nummod/nummod.lisp")$
(%i5) compare(5,6);
(%o5) <
Yes, nummod and mod disagree for some negative inputs.
My nummod function is suppose to follow the definition in
"Concrete Mathematics," by Graham, Knuth, and Patashnik.
nummod is also supposed to mimic the behavior of Macsyma.
I'm not sure mod and nummod should be merged -- I
haven't looked into that.
Other:
(1) The nummod ode uses my version of compare.
(2) In part, I wrote nummod to help fix branch cut
bugs; for example
carg(exp(%i * x)) --> x - nummod(%pi - x, 2 * %pi)
Barton