I've been playing with rational numbers which allow the denominator to be zero. While
these don't solve the problem of continued fractions (discussed previously), they do
allow for the representation of +oo ("inf") and -oo ("minf"), and comparisons with them
work correctly.
x=xn/xd < y=yn/yd iff xn*yd < yn*xd.
If x=xn/xd is finite, then -1/0 < xn/xd and xn/xd < 1/0.
Proof. -1*xd < 0*xn=0 and 0=xn*0 < 1*xd (xd>0 because x is finite).
(It's a bad idea to allow denominators to be negative, because it does screw up comparisons.)
The good news: k/0 = sign(k)/0, because gcd(k,0)=abs(k), so all versions of inf are = and all versions of minf are =.
The bad news: -1/0 = 1/0 (-1*0=1*0), so we don't have minf<inf.
We could cheat by using IEEE -0.0: -1*0.0 = -0.0 < 1*0.0 = +0.0.
Or we simply recognize this case specially, and force -1/0 < 1/0.
Perhaps Common Lisp err'ed in not allowing -1/0, 1/0.
Common Lisp desperately needs identities for min & max, so that
(min) = 1/0 = inf ('min' with 0 arguments) and
(max) = -1/0 = minf ('max' with 0 arguments).