1/0=inf, -1/0=minf



Also

http://dl.acm.org/citation.cfm?id=1219095
The rational numbers as an abstract data type

could be of interest (it shows how to work well with 1/0 = 0).

There are various papers follow up on this new algebraic structure.

Oliver


On Mon, Aug 05, 2013 at 07:23:40AM -0700, Richard Fateman wrote:
> You might look at ..
> computation with the extended rational numbers...
> 
> www.cs.berkeley.edu/~fateman/papers/extrat.pdf?
> (1994)
> 
> RJF
> 
> 
> On 8/5/2013 6:19 AM, Henry Baker wrote:
> >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).
> >
> >_______________________________________________