Newsgroups: comp.lang.lisp
Path: cantaloupe.srv.cs.cmu.edu!rochester!cornellcs!newsstand.cit.cornell.edu!newstand.syr.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!www.nntp.primenet.com!nntp.primenet.com!mr.net!news.sgi.com!su-news-hub1.bbnplanet.com!cam-news-hub1.bbnplanet.com!news.bbnplanet.com!howland.erols.net!torn!kwon!watserv3.uwaterloo.ca!news
From: Kevin Mayall <kmayall@uwaterloo.ca>
Subject: equality of floating point numbers
Content-Type: text/plain; charset=us-ascii
Message-ID: <331C4855.3E0B@uwaterloo.ca>
Sender: news@watserv3.uwaterloo.ca
Nntp-Posting-Host: cnts99p19.uwaterloo.ca
Reply-To: kmayall@uwaterloo.ca
Content-Transfer-Encoding: 7bit
Organization: University of Waterloo
Mime-Version: 1.0
Date: Tue, 4 Mar 1997 16:05:41 GMT
X-Mailer: Mozilla 3.0 (Win95; I)
Lines: 34

A friend recently gave me a crash-course in the issues of computing the
equality of floating-point numbers.  I've written functions such as f=,
f<, f>, etc., which use an epsilon value to test for fp equality.  I
want to make these into CLOS methods on =, <, >, etc., for arguments of
the class, Float (that way, I don't have to worry about whether I'm
calling the fp or non-fp function).  I'm led to believe this is common
practice in CL.

However, when I load the system (I'm using Allegro for Windows web
version), I'm given the warning message about redefining a regular
function as a generic function. e.g.

 Error: Attempt to redefine the non-generic function = as generic.

I can choose to "Redefine it as generic" from the pop-up window, but
that's a bit unreasonable to do for each fp function every time I load
my system.  I'm told that this protection is done for efficiency
reasons.  But I still don't know what to DO about it.

So my question is how do CL programmers generally hide these fp
functions so that they may be used via the regular =, <, >, etc.
functions?

Cheers................

	Kev


--------------------------------Bermuda Massive
Kevin Mayall               kmayall@uwaterloo.ca
         http://www.fes.uwaterloo.ca/u/kmayall/
     School of Planning, University of Waterloo


