Re: floating point interpretation

From: John Herbster \(TeamB\) (herb-sci1_at_sbcglobal.net)
Date: 10/09/03


Date: Thu, 9 Oct 2003 15:48:45 -0500


"Tim Armstrong" <tim.armstrong@doorgroup.com> wrote
> ...
> Interbase 6.03
> Delphi6 Enterprise
> W2KAdvanceServer
> Service Pack 4
> ...
> Our database has numerous fields that are float based e.g.
> 1.122345.

I presume that you mean that these numbers are stored in the
database as type double or another floating binary point format.

> Some calculations are based off these floats e.g. Cost x Quantity.
> In some reports we display the quantity directly from database.

As you may know, the type double and other floating binary
point formats cannot store most decimal fraction numbers w/o
rounding to the nearest *binary* fraction. In other words,
0.1 and 0.01 cannot be exactly stored.

> On 1 out 115 clients, the report displays the actual float
> number, 1.122345. The rest of the clients' reports shows 1.

Tim, This sounds like the FPU Control Word may be set
diffenently on the different clients machines. You can check
the value of the FPU control word with the following code:

  Assert( ((Get8087CW and $1F3F) = $1332),
       Format('Prob with FPUCW($%4x)',[Get8087CW]));

What it will do is to generate an exception if your application
is running with the internal FPU control word set wrong.

Make sure that Asserts are turned *on* in the compiler options.
It will give you an exception, if the FPU control word is set wrong.

If the control word is wrong, then I would look for source
of the change but you may just wish to drop one or more
  Set8087CW($1332)
calls into your code, maybe in the FormCreate() to correct
the value.

You may also want to look at the several Quality Central reports
dealing with the FPU control word. See report #5928 and
search for others using FPU as the key word.

You may be able to find the machines differences just by using the
T_CkFPU_1 program that is attached to QC report #5928.

Please let us know what you find.

Rgds, JohnH



Relevant Pages

  • Re: floating point interpretation
    ... > database as type double or another floating binary point format. ... >> In some reports we display the quantity directly from database. ... > the value of the FPU control word with the following code: ...
    (borland.public.delphi.language.objectpascal)
  • Please Help Me: HTMLText Interpretation causes lots of Problems to me.
    ... I am using Crystal Reports integrated with MicroSoft Visual Studio.Net ... Database is MS Access 2003 and OS is ... The request could not be submitted for background processing. ... Exception Details: CrystalDecisions.CrystalReports.Engine.InternalException: ...
    (microsoft.public.vb.crystal)
  • HTMLText Interpretation generates runtime error
    ... I am using Crystal Reports integrated with MicroSoft Visual Studio.Net ... Database is MS Access 2003 and OS is ... The request could not be submitted for background processing. ... Exception Details: CrystalDecisions.CrystalReports.Engine.InternalException: ...
    (microsoft.public.vb.crystal)