*BSD News Article 53955


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.uwa.edu.au!classic.iinet.com.au!swing.iinet.net.au!news.uoregon.edu!tank.news.pipex.net!pipex!news.mathworks.com!newsfeed.internetmci.com!news.sprintlink.net!clue.callamer.com!usenet
From: steve@diana.miranova.com (Steven L. Baur)
Newsgroups: comp.unix.bsd.freebsd.misc,gnu.emacs.help
Subject: Re: Floating point arithmetic in ELisp.
Date: 03 Nov 1995 14:25:34 -0800
Organization: Miranova Systems, Inc.
Lines: 31
Sender: steve@diana.miranova.com
Message-ID: <m2ybtxl4ip.fsf@diana.miranova.com>
References: <47ae1c$68e@blackice.winternet.com>
	<GDR11.95Nov3163002@stint.cl.cam.ac.uk>
NNTP-Posting-Host: miranova.com
NNTP-Posting-User: steve
In-reply-to: gdr11@cl.cam.ac.uk's message of 03 Nov 1995 16:30:02 GMT
X-Url: http://www.miranova.com/%7Esteve/
X-Newsreader: Gnus v5.0.12 with tm patch
Xref: euryale.cc.adfa.oz.au comp.unix.bsd.freebsd.misc:8147 gnu.emacs.help:29551

>>>>> "Gareth" == Gareth Rees <gdr11@cl.cam.ac.uk> writes:
> John D. Boggs <jdb@robigo.winternet.com> wrote:
    >> I am teaching myself LISP using the lisp interaction mode in
    >> Emacs, and it doesn't seem to like floating point arithmetic.
    >> For instance, the expression (+ 3.14 2.71) returns
    >> 5.8499999999999996.  I was curious, is this typical of Emacs
    >> 19.29, or is it a result of running under
    >> FreeBSD-2.0.5-950622-SNAP?  I don't foresee needing floating
    >> point with what I have in mind, but you never know ...

    Gareth> What happened here was that the number 5.85 is not
    Gareth> representible in whatever floating-point format Emacs
    Gareth> uses.

It is Emacs/system dependent.

(On a Linux 1.2/a.out system -- as typed in a Lisp Interaction buffer)

emacs-version
"19.13 XEmacs Lucid"
(+ 3.14 2.71)
5.85


emacs-version
"19.28.1"
(+ 3.14 2.71)
5.8499999999999996

-- 
steve@miranova.com baur