🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.delphi.migration
2 messages
2 total messages Started by John Algeo Wed, 09 May 2007 23:29
BC 3.1 float division <> Delphi 2005 Single division
#141
Author: John Algeo
Date: Wed, 09 May 2007 23:29
20 lines
1531 bytes
In upgrading code written in Borland C++ 3.1 to Delphi 2005, I
have found subtle differences in the results of a division of the
form:

A = (B - C) / I;

where A, B, and C are floats in C or Singles in Delphi and I is
an int or Integer (I is 2).  Some of the results differ in the
least significant digit.  I know that the '/' operator is defined
differently in C and Delphi, but all floating point operations
ought to be done in the 8087 in extended precision, so why is
there a difference in A depending on the development system?

Can Delphi be forced to produce the same result as the old 
system?

I do not have access to BC++, only the compiled application.

John
Re: BC 3.1 float division <> Delphi 2005 Single division
#143
Author: John Algeo
Date: Tue, 15 May 2007 14:40
29 lines
1824 bytes
The 16 bit code is using win87em.dll. The version of the DLL in
the \System directory gives slightly different results than the
8087, but the newer version in \System32 agrees with the 
hardware.

John

"John Algeo" <john@algeoconsulting.com> wrote:
>
>In upgrading code written in Borland C++ 3.1 to Delphi 2005, I
>have found subtle differences in the results of a division of the
>form:
>
>A = (B - C) / I;
>
>where A, B, and C are floats in C or Singles in Delphi and I is
>an int or Integer (I is 2).  Some of the results differ in the
>least significant digit.  I know that the '/' operator is defined
>differently in C and Delphi, but all floating point operations
>ought to be done in the 8087 in extended precision, so why is
>there a difference in A depending on the development system?
>
>Can Delphi be forced to produce the same result as the old 
>system?
>
>I do not have access to BC++, only the compiled application.
>
>John
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads