🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.csharpbuilder.language.csharp
Article #84

Re: Wrong calc with Double

#84
From: Craig Stuntz TeamB
Date: Wed, 08 Mar 2006 19:37
16 lines
1640 bytes
Jose Maria Sanmartin wrote:

> In the MessageBox I get -2.8421709430404E-14 instead of 0.

	I wouldn't call that wrong. -2.84 ^-14 is pretty darn close to zero.
This is normal floating point rounding error.

	You might want to read this:

http://www.guidogybels.net/index.html?floats.html

-- 
Craig Stuntz [TeamB] � Vertex Systems Corp. � Columbus, OH
  Delphi/InterBase Weblog : http://blogs.teamb.com/craigstuntz
Everything You Need to Know About InterBase Character Sets:
  http://blogs.teamb.com/craigstuntz/articles/403.aspx
Technical Details
Message-ID: <440f406c@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <440f3e44@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 1efe35,fe16f5826c706566
X-Google-Attributes: gid1efe35,public
X-Google-Language: ENGLISH,ASCII
From: "Craig Stuntz [TeamB]" <craig_stuntz@nospam.please [a.k.a. acm.org]>
Subject: Re: Wrong calc with Double
Newsgroups: borland.public.csharpbuilder.language.csharp
References: <440f3e44@newsgroups.borland.com>
Organization: Vertex Systems Corporation
User-Agent: XanaNews/1.17.6.4
X-Face: "huzh55Xi]!ZNni78>a*5+).`SK?<^q2MlHk-C]Z2M9T@\J5ZCB$95Ey+s"XQuhGFA[eutZ:0^AV!Q;t>gE`1-=8d;HZ6~*o1dH<X9\b$!|(}+I'!Xq)@3Op}%0ArW&nf'Qh*EwR
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
NNTP-Posting-Host: 24.106.104.204
Message-ID: <440f406c@newsgroups.borland.com>
Date: 8 Mar 2006 12:37:00 -0700
X-Trace: newsgroups.borland.com 1141850220 24.106.104.204 (8 Mar 2006 12:37:00 -0700)
Lines: 16
X-Authenticated-User: cstuntz
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail