Date: Thu, 6 Jan 2000 12:09:44 +0100 (MET) From: Jens Bischoff To: djgpp AT delorie DOT com Subject: Re: DJGPP BUG!!!!!!! ??? In-Reply-To: <851o9m$h4t$1@news.lth.se> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 Precedence: bulk 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 | | --< >-- : DaimlerChrysler Aerospace Airbus GmbH | | | : Aerodynamic Data Department (EFD) | | Dasa Airbus : D-28183 Bremen - Germany |