🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: 0.3-0.2=0.999999999998?

#16313
From: Rick Stabile
Date: Tue, 09 Mar 1999 00:00
29 lines
1858 bytes
Am I not getting something here? I tried this in PowerJ and my result was
0.1. In any case, I could understand a result of 0.0999999999998, or even
0.999999999998E-01 -- it's floating point arithmetic and this sort of result
is to be expected. But did the author of this post simply make a typo that no
one else mentioned, or is his result really an order of magnitude too large
(in which case, his concern is justified)?

In article <7blg56$2pl$1@zonnetje.NL.net>,
  "-=(CyBerco)=-" <Berco.Beute@EverMind.com> wrote:
> Hi,
>
> Try the following:
>
> System.out.println("What is 0.3-0.2 ? :  " + (0.3-0.2));
>
> How come? I sure didn't expect this outcome!
>
> Greetings,
> Berco.
>
>

Rick Stabile, Sun Certified Java Programmer
----
For information on the Java Certification exam,
see my website: http://www.geocities.com/SiliconValley/Circuit/8217/

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    
Technical Details
Message-ID: <7c3t96$tj8$1@nnrp1.dejanews.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <7blg56$2pl$1@zonnetje.NL.net>

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: Rick Stabile <stabilpa@my-dejanews.com>
Subject: Re: 0.3-0.2=0.999999999998?
Date: 1999/03/09
Message-ID: <7c3t96$tj8$1@nnrp1.dejanews.com>
X-Deja-AN: 453069418
References: <7blg56$2pl$1@zonnetje.NL.net>
X-Http-Proxy: 1.0 x6.dejanews.com:80 (Squid/1.1.22) for client 205.144.126.2
Organization: Deja News - The Leader in Internet Discussion
X-Article-Creation-Date: Tue Mar 09 19:37:11 1999 GMT
Newsgroups: borland.public.jbuilder.java.language,comp.lang.java,comp.lang.java.programmer
X-Http-User-Agent: Mozilla/4.5 [en] (Win95; I)