Newsgroups: comp.lang.scheme
Path: cantaloupe.srv.cs.cmu.edu!rochester!udel-eecis!gatech!csulb.edu!news.sgi.com!news.mathworks.com!howland.erols.net!ix.netcom.com!hbaker
From: hbaker@netcom.com (Henry Baker)
Subject: Re: implementing the scheme number tower.
Content-Type: text/plain; charset=ISO-8859-1
Message-ID: <hbaker-1902970924100001@10.0.2.1>
Sender: hbaker@netcom2.netcom.com
Content-Transfer-Encoding: 8bit
Organization: nil
X-Newsreader: Yet Another NewsWatcher 2.2.0
References: <9ceF3D1w165w@codeworks.gen.nz>
Mime-Version: 1.0
Date: Wed, 19 Feb 1997 17:24:10 GMT
Lines: 21

In article <9ceF3D1w165w@codeworks.gen.nz>, geoff@codeworks.gen.nz (Geoff
Reynolds) wrote:

> If a scheme implementation represents integer and rational numbers 
> exactly, but represents reals (other than integers and rationals) as 
> inexact (limited precision floating point), does it make any sense to 
> allow for the exact representation of complex numbers (other than 
> integers and rationals)?

Yes!!  For example, the 'Gaussian Integers' are complex numbers of the
form m+ni, m,n 'rational' integers.  Gaussian integers are an excellent
stepping off place for the study of algebraic integers, and have nice
properties -- e.g., unique factorization, gcd algorithm, etc.

See

ftp://ftp.netcom.com/pub/hb/hbaker/Gaussian.html  (also .ps.Z)

In particular, I would extend Scheme's gcd to produce the correct answer
for Gaussian integers.  The above paper shows how to do this with 1/2 page
of code.
