www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/01/06/11:53:43

Date: Thu, 6 Jan 2000 12:09:44 +0100 (MET)
From: Jens Bischoff <bischoff AT airbus DOT dasa DOT de>
To: djgpp AT delorie DOT com
Subject: Re: DJGPP BUG!!!!!!! ???
In-Reply-To: <851o9m$h4t$1@news.lth.se>
Message-Id: <Pine.HPX.4.20.0001061200010.14046-100000@warnow.bre.airbus.dasa.de>
Mime-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: dj-admin AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

Niklas Pettersson schrieb am 06.01.00 um 10:45 Uhr:

> I think I have found an error in DJGPP... It's illustrated by the following
> example:

This is not an error. It's a rounding problem. 
The double value 0.1 cannot be represented exactly as a binary
number. It's machine representation (x) is not exact 0.1 but a little
smaller. So, ten times this value (x) is not exactly 1 but something 
like 0.999999...., and when you cast this to an integer number you
will get "0".

Jens

---
|      |      : Jens Bischoff  <j DOT bischoff AT airbus DOT dasa DOT de> |
|   --< >--   :   DaimlerChrysler Aerospace Airbus GmbH    |
|      |      :     Aerodynamic Data Department (EFD)      |
| Dasa Airbus :          D-28183 Bremen - Germany          |
    

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019