Subject RE: [ib-support] Strange roundings in IB-5.6
Author Martijn Tonies

InterBase isn't lying to you - it's returning FLOATING POINT values.

Floating point values aren't precise, never, not in any language - if
you want exact numerics, use NUMERIC(15, 2) or so as the datatype.

Martijn Tonies
InterBase Workbench - the developer tool for InterBase and Firebird

IB 5.6 + Mandrake Linux 7.2

Hi gang.

I'm getting very angry about a quirk of Interbase with double precision
I store in a Double precision field (Importe) , the value 8200.14
Interbase holds 8200.13999999999999999
Well... not inusual. I know about some glitches in the Delphi way of
double values , so i make a external function ,

where numero stands for a double precision and decimales for an integer
gives the number of decimals required at most.

The C functions looks like
switch decimales {
2 : return rint(*numero*100)/100

I compile , link , declare the external , etc...

when in ISQL using the function in a select as

select nombre , orden_carga , ndecimals(importe,2) from v_excel_oc

(in fact , is a view , but it should'nt matter)

i got a lot of perfectly suitable values (in fact , i know that some of
has been corrected by the ndecimals fuction because if i do it straight
without the function , somes a large number of decimals) , except the

So , now , i know is interbase who is lying to me , not the bloody
Delphi 4
and his wicked arithmetics.

Any ideas to lower my blood presure?

B.T.W. . Could someone tell me what system table i should query to
the code for creation of the user tables ? Sort of a extract database in
isql , but by delphi code / sql query.

EntreBytes S.L.
Ontenient , Spain
ERP Development.

Yahoo! Groups Sponsor

To unsubscribe from this group, send an email to:

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.