Board index » delphi » Consistent, Repeatable Floating Point Discrepancy in D3

Consistent, Repeatable Floating Point Discrepancy in D3

I've found an inconsistancy in a floating point operation
that depends on the version of OlePro32.dll on the user's
system at run-time. I've tested this compiled program on
about 12 machines. A good mix of both Win95 and WinNT4
machines with various service packs.

Here are the vital stats:

The 2 versions of OlePro32.dll I'm working with are:
OlePro32.dll -> File Version: 5.0.4118
OlePro32.dll -> File Version: 5.0.4055

Here's the project that demonstrates the inconsistancy:

program Project1;

  OleCtrls, //Inclusion of this file causes the inconsistancy!!!!
  Unit1 in 'Unit1.pas' {Form1};

{$R *.RES}

  Application.CreateForm(TForm1, Form1);

procedure TForm1.Button1Click(Sender: TObject);
  f3 : Extended;

  f3 := Exp(83);
  Edit1.Text := FloatToStrF(f3, ffExponent, 18, 18);

If you examine the value of f3 when version 5.0.4118 of OlePro32.dll is
active on the system you get:
                     <Differs here>

If version 5.0.4055 is active then you get:
                   <Differs here>

I've got a workaround for the problem right now, but if anyone can figure
this out, I'd really like to know the cause.

Thanks in advance,

Christopher D. Coppola
Advanced Creative Technologies III, Inc.


Re:Consistent, Repeatable Floating Point Discrepancy in D3

On Wed, 4 Jun 1997 06:43:50 -0700, (Christopher D.

Coppola) wrote:

>The 2 versions of OlePro32.dll I'm working with are:
>OlePro32.dll -> File Version: 5.0.4118
>OlePro32.dll -> File Version: 5.0.4055

Are you sure this is a cause, or is it just a symtom?  Could it be
that there is some other file (probably one that gets pulled in by
OldPro32.dll) that is also different?

What happens if you copy the 5.0.4118 version onto a system that had
the 5.0.4055 version?  Does it's calculation change?

Have you tried forcing the compiler to generate "Flawed Pentium" safe
code?  Before the calculation, try {$U+} and after, {$U-}

With or without OleCtrls in my USES statement, I got the 6464 answer.

Chuck Gadd
Director of Software Development, {*word*104} FX Communications.
e-mail:cgadd-NOS...@{*word*104}  http://www.{*word*104}
Remove the -NOSPAM from my email address to send me e-mail.
*** I boycott businesses that send me unsolicited email adverti{*word*224}ts ***

Other Threads