🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: 0.3-0.2=0.999999999998?

#16327
From: Steve Chapel
Date: Wed, 10 Mar 1999 00:00
14 lines
1365 bytes
Chris Ruml wrote:
> 
> This is why it was Programming 101 (give or take) that explained that one should
> never use
>                 (double1 == double2)
> to check equality of such inexact numeric values but rather
>                 (abs(double1-double2) < some_tolerance) .

And it was Programming 102 that explained why some_tolerance
should not be an absolute value, but should be relative to
double1 or double2. :-)

Actually, for me it was _The_Elements_of_Programming_Style_ that
explained it.
Technical Details
Message-ID: <36E6CD8E.CC8CB2C4@utilicom.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <7blg56$2pl$1@zonnetje.NL.net> <7c3t96$tj8$1@nnrp1.dejanews.com> <36e65000.9658117@news.uni-erlangen.de> <36E69EDB.F6A8B7@medsweb.com>

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: Steve Chapel <schapel@utilicom.com>
Subject: Re: 0.3-0.2=0.999999999998?
Date: 1999/03/10
Message-ID: <36E6CD8E.CC8CB2C4@utilicom.com>
X-Deja-AN: 453504202
Content-Transfer-Encoding: 7bit
References: <7blg56$2pl$1@zonnetje.NL.net> <7c3t96$tj8$1@nnrp1.dejanews.com> <36e65000.9658117@news.uni-erlangen.de> <36E69EDB.F6A8B7@medsweb.com>
X-Accept-Language: en
Content-Type: text/plain; charset=us-ascii
X-Trace: 921095578 200 (none) 204.188.4.138
MIME-Version: 1.0
Newsgroups: borland.public.jbuilder.java.language,comp.lang.java,comp.lang.java.programmer