🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.prolog
Article #1076

Re: Fun With Floats in Quintus

#1076
From: Paul Eggert
Date: Tue, 14 Aug 1990 03:46
24 lines
1643 bytes
R. Kym Horsell writes:

	There are some real numbers which can't be represented in floating
	point. The language (nor implementation) is not at fault.  For example,
	try to write down the representation of 0.1 (decimal) in binary.

This cliche doesn't apply to Iverson's problem.  Free-format output should
print no more digits than are needed to communicate the value.  For example,
with IEEE double precision floating point, the closest representable number to
8.1 is X = 8.0999999999999996447286321199499070644378662109375.  But when I
print X in free format, I should see just "8.1", because it's much shorter
and communicates X equally well.  For more on this subject, see:

	William D Clinger
	How to Read Floating Point Numbers Accurately
	Sigplan notices 25, 6 (June 1990), 92-101.

	Guy L. Steele Jr. and Jon L White
	How to Print Floating-Point Numbers Accurately
	Sigplan notices 25, 6 (June 1990), 112-126.

Perhaps Quintus's problem is that they've stolen some low order bits of the
fraction for Prolog tag bits, but their I/O routines are the same as C's and
are thus programmed as if the low order bits were significant.
Technical Details
Message-ID: <1990Aug14.034632.5561@twinsun.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!sdd.hp.com!usc!orion.oac.uci.edu!ucivax!ucla-cs!twinsun!eggert
References: <EIVERSON.90Aug13174424@aigyptos.nmsu.edu> <3829@bingvaxu.cc.binghamton.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!sdd.hp.com!usc!orion.oac.uci.edu!ucivax!ucla-cs!twinsun!eggert
From: eggert@twinsun.com (Paul Eggert)
Newsgroups: comp.lang.prolog
Subject: Re: Fun With Floats in Quintus
Message-ID: <1990Aug14.034632.5561@twinsun.com>
Date: 14 Aug 90 03:46:32 GMT
References: <EIVERSON.90Aug13174424@aigyptos.nmsu.edu> <3829@bingvaxu.cc.binghamton.edu>
Sender: usenet@twinsun.com
Organization: Twin Sun, Inc
Lines: 24