Xref: utzoo comp.lang.lisp:2935 comp.lang.scheme:1177 comp.lang.smalltalk:1771 comp.object:1065 Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uflorida!uakari.primate.wisc.edu!zaphod.mps.ohio-state.edu!think!barmar From: barmar@think.com (Barry Margolin) Newsgroups: comp.lang.lisp,comp.lang.scheme,comp.lang.smalltalk,comp.object Subject: Re: IEEE FP NaNs = everything else? Message-ID: <34725@news.Think.COM> Date: 16 Mar 90 05:41:07 GMT References: <1990Mar15.211150.19338@Neon.Stanford.EDU> Sender: news@Think.COM Reply-To: barmar@nugodot.think.com.UUCP (Barry Margolin) Followup-To: comp.lang.lisp Organization: Thinking Machines Corporation, Cambridge MA, USA Lines: 19 In article <1990Mar15.211150.19338@Neon.Stanford.EDU> max@Neon.Stanford.EDU (Max Hailperin) writes: >Has anyone explored the possibility of useing IEEE floating-point as a >general representation in a manifestly-typed language, with everything >other than flonums being NaNs (Not-A-Numbers)? The IEEE rule is that any arithmetic involving NaNs must result in a NaN. But if fixnums are implemented as NaNs then this means that (+ 3.0 1) must evaluate to a NaN rather than 4.0, since this would be (+ 3.0 NaN). Perhaps, instead of using NaNs for all non-fixnums you should use NaNs for all non-numbers (NaN *does* stand for Not a Number, so this makes sense). You could then use signalling NaNs, which would cause ordinary IEEE FP hardware to trap on things like (+ 3.0 'a). -- Barry Margolin, Thinking Machines Corp. barmar@think.com {uunet,harvard}!think!barmar