Article View: borland.public.jbuilder.java.language
Article #16368Re: 0.3-0.2=0.999999999998?
From: Jean-Baptiste Nizet
Date: Thu, 04 Mar 1999 00:00
Date: Thu, 04 Mar 1999 00:00
47 lines
2129 bytes
2129 bytes
This is a multi-part message in MIME format.
--------------BC87A26BCA6A3A5C4E6DF694
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
It's a normal result, and you will have such surprises whatever language or
computer you use.
1. Computers work with numbers in a binary way, not in a decimal way
2. All real numbers can't be exactly managed by float numbers.
"-=(CyBerco)=-" 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.
--------------BC87A26BCA6A3A5C4E6DF694
Content-Type: text/x-vcard; charset=us-ascii;
name="jbz.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Jean-Baptiste Nizet
Content-Disposition: attachment;
filename="jbz.vcf"
begin:vcard
n:Nizet;Jean-Baptiste
x-mozilla-html:TRUE
org:<center><a href=http://www.ficsgrp.com>FICS Group</a></center>
adr:;;Excelsiorlaan, 87;1930 Zaventem;;;Belgium
version:2.1
email;internet:jean-baptiste.nizet@ficsgrp.com
title:ComSec Engineer
x-mozilla-cpt:;0
tel;home:04/222.93.62
tel;work:02/71.44.542
fn:Jean-Baptiste Nizet
end:vcard
--------------BC87A26BCA6A3A5C4E6DF694--
Technical Details
Message-ID:
<36DE4DC2.5E9963CD@ficsgrp.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<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: Jean-Baptiste Nizet <jbz@ficsgrp.com> Subject: Re: 0.3-0.2=0.999999999998? Date: 1999/03/04 Message-ID: <36DE4DC2.5E9963CD@ficsgrp.com> X-Deja-AN: 451091557 Cache-Post-Path: watson!unknown@172.16.11.27 References: <7blg56$2pl$1@zonnetje.NL.net> To: "-=(CyBerco)=-" <Berco.Beute@EverMind.com> X-Accept-Language: en Content-Type: multipart/mixed; boundary="------------BC87A26BCA6A3A5C4E6DF694" Organization: FICS Group X-Cache: nntpcache 2.3.3 (see http://www.nntpcache.org/) Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.language,comp.lang.java,comp.lang.java.programmer