🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: 0.3-0.2=0.999999999998?

#16144
From: Shannon Wheeler
Date: Tue, 30 Mar 1999 00:00
40 lines
2020 bytes
Jean-Baptiste Nizet wrote in message <36DE4DC2.5E9963CD@ficsgrp.com>...
>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.


This is wrong. Many real numbers can be managed exactly by float(ing point)
numbers.
but,
NOT all real numbers can be managed exactly by floating point numbers.

Who'd ever have thought that syntax is important?

*The opinions expressed herein are my own and are not necessarily
representative of the policies or opinions of my employer.*

Shannon Wheeler
Data & Comm. Tech
Clearwater Welding & Fabricating Ltd
Fort McMurray, AB

Remove the lucky rodent parts from my address to reply.

>
>
>"-=(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.
>
Technical Details
Message-ID: <922830803.229567@tmp33.tnc.ab.ca>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <7blg56$2pl$1@zonnetje.NL.net> <36DE4DC2.5E9963CD@ficsgrp.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: "Shannon Wheeler" <swheelerRabbit@Foottnc.com>
Subject: Re: 0.3-0.2=0.999999999998?
Date: 1999/03/30
Message-ID: <922830803.229567@tmp33.tnc.ab.ca>
X-Deja-AN: 460910763
Cache-Post-Path: tmp33.tnc.ab.ca!unknown@fort8.tnc.com
References: <7blg56$2pl$1@zonnetje.NL.net> <36DE4DC2.5E9963CD@ficsgrp.com>
X-Mimeole: Produced By Microsoft MimeOLE V4.72.3110.3
X-Trace: thor.cal.sfl.net 922830808 139.142.36.34 (Tue, 30 Mar 1999 14:53:28 MDT)
Organization: Ye 'Ol Disorganized NNTPCache groupie
X-Cache: nntpcache 2.3.3b4 (see http://www.nntpcache.org/)
NNTP-Posting-Date: Tue, 30 Mar 1999 14:53:28 MDT
Newsgroups: borland.public.jbuilder.java.language,comp.lang.java,comp.lang.java.programmer