🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #16302

Re: 0.3-0.2=0.999999999998?

#16302
From: glen herrmannsfeldt
Date: Mon, 08 Mar 1999 00:00
23 lines
1892 bytes
roedy@mindprod.com (Roedy Green) writes:

>The IBM 360 packed decimal -- 1 nibble per digit plus sign still
>handled only integers, not floating point.  It was quite a bit slower
>than binary arithmetic, and usually not as compact.  The main reason
>to use it was for numbers too big to fit in 31 bits. The PL/1 compiler
>would do some scaling for you which was its other attraction.  

Packed decimal was slow because that was the way it was implemented.
Though for simple calculations still probably faster than converting to
binary and back again.  CVB and CVD are pretty slow on many implementations.

PL/I also supported float decimal, which was usually (unless someone wrote
a compiler for the CDC STAR-100) implemented in binary.

>Today's programmers, raised on machines with hardware floating point,
>seem to think that scaling an integer and inserting a decorative
>decimal point is rocket science.  They keep needlessly reverting to
>floating point with its speed penalities and fuzz problems.

Library support for printing numbers with decimal points would help.

-- glen
Technical Details
Message-ID: <7c19l8$2od@gap.cco.caltech.edu>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <7blg56$2pl$1@zonnetje.NL.net> <36DE833A.DFA9E627@alphalink.com.au> <36e3c58e.73834728@news.bctel.ca> <wkk8wwlumi.fsf@mail.online.no> <36e00a8e.91498267@news.bctel.ca>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f5d71,3b89176b465afef
X-Google-Attributes: gidf5d71,public
X-Google-Thread: f74b3,3b89176b465afef
X-Google-Attributes: gidf74b3,public
X-Google-Thread: 10a146,3b89176b465afef
X-Google-Attributes: gid10a146,public
From: gah@ugcs.caltech.edu (glen herrmannsfeldt)
Subject: Re: 0.3-0.2=0.999999999998?
Date: 1999/03/08
Message-ID: <7c19l8$2od@gap.cco.caltech.edu>
X-Deja-AN: 452682376
References: <7blg56$2pl$1@zonnetje.NL.net> <36DE833A.DFA9E627@alphalink.com.au> <36e3c58e.73834728@news.bctel.ca> <wkk8wwlumi.fsf@mail.online.no> <36e00a8e.91498267@news.bctel.ca>
Organization: California Institute of Technology, Pasadena
Newsgroups: borland.public.jbuilder.java.language,comp.lang.java,comp.lang.java.programmer