Xref: utzoo comp.lang.scheme:1823 comp.lang.lisp:4017 Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!samsung!munnari.oz.au!goanna!ok From: ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe) Newsgroups: comp.lang.scheme,comp.lang.lisp Subject: Re: Numerical gotcha's Keywords: Interval-Arithmetic Bignums Rationals Message-ID: <4361@goanna.cs.rmit.oz.au> Date: 23 Nov 90 07:56:19 GMT References: <431@data.UUCP> Followup-To: comp.lang.scheme Organization: Comp Sci, RMIT, Melbourne, Australia Lines: 18 In article <431@data.UUCP>, kend@data.UUCP (Ken Dickey) writes: > ;; ELK 1.1: f = 1.18059162071741e+21 [Sun3] ??? {floats only} > ;; THE CORRECT ANSWER IS: > ;; (tryit) -> -54767/66192 {Gambit 1.4; sun3; rationals+bignums} On an Encore Multimax, T 3.0 gave the correct answer. However, when the numeric literals were changed to floating point (e.g. 333.75 instead of (/ 1335 4), 121.0 instead of 121) and the x, y arguments were written as floats, the answer came out at roughly -1.1806e21. Since the Sun3 and the Encore both provide IEEE 754 arithmetic, I imagine other IEEE 754 machines will give the same answer. The moral is (if (and (inexact? x) (not (numerical-analyst? *you*))) (doubt *you* x)) -- I am not now and never have been a member of Mensa. -- Ariadne.