Menu ▾ ▴

#5640 cfdisrep builds rationals with a negative denominator

None
open
nobody
cfdisrep (1)
5
2026-10-04
2026-10-04
No

By Claude:

cfdisrep builds the rational 1/a for the last term a even when a is negative. Such a rational is not a valid Maxima number, and arithmetic with it goes wrong:

(%i1) c: cfdisrep([1, -2]);
(%o1) 1+1/(-2)
(%i2) c - c;
(%o2) 1/(-2)+1/2
(%i3) ?print(c)$
((MPLUS SIMP CF) 1 ((RAT SIMP) 1 -2))

c - c should be 0. The same happens for a last term of 1 or -1.

Discussion


Log in to post a comment.