Newsgroups: comp.lang.lisp
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!news.mathworks.com!hookup!olivea!charnel.ecst.csuchico.edu!waldorf.csc.calpoly.edu!decwrl!adobe!machine.mv.us.adobe.com!user
From: jmeehan@mv.us.adobe.com (Jim Meehan)
Subject: Why is (round 2.5) = 2?
Message-ID: <jmeehan-1504951641460001@machine.mv.us.adobe.com>
Sender: usenet@adobe.com (USENET NEWS)
Organization: Adobe Systems Inc.
X-Newsreader: Value-Added NewsWatcher 2.0b24.0+
Date: Sun, 16 Apr 1995 00:41:46 GMT
Lines: 15

In Common Lisp, round, when applied to a number of the form integer+0.5,
returns either integer or integer+1, whichever is even. Does anyone
remember why it was defined that way?

For comparison, Scheme does it the same way. fixr in ZetaLisp always
rounds up. The Lisp 1.6 manual shows a sample definition that also rounds
up. Pascal and PostScript round up.

I didn't see a 'round' operator in my books on Algol, Ada, APL, Basic, C,
Fortran, LispVM, MacLisp, ML, or Snobol.

There is one in Smalltalk-80, but from the manual, I couldn't tell what
happens in this case.

In Modula-3, the result depends on a thread-specific variable.
