Subject Re: [IB-Architect] Floating pointing operations troubles
Author Helen Borrie
Wrong list. Please send this to delphi-db or perhaps interbase@...

Thank you.
Helen (Moderator)

At 11:10 AM 11-07-00 -0300, you wrote:
> I'm in trouble in an operation envolving float values. I'm using
>Delphi 5 with Interbase 6.0. The problematic routine is:
>With Query1 do
> first;
> while not eof do
> begin
> Query2.ParamByName('codigo').asstring:=fieldbyname
> Query2.prepare;
> Query2.edit;
> Query2.fieldbyname('PR_customedio').asfloat:=
> (Query2.fieldbyname('PR_saldo').asfloat*
> Query2.fieldbyname('PR_customedio').asfloat)+
> (fieldbyname('IE_qtdereal').asfloat*
> fieldbyname('IE_precocompra').asfloat)/
> (Query2.fieldbyname('PR_saldo').asfloat+
> fieldbyname('IE_qtdereal').asfloat);
> Query2.close;
> next;
> end;
> All the envolved fields in the above calculation are defined like
>DOUBLE PRECISION fields. I'm using two TIBQuery connected to two
> The problem is that sometimes it works perfectly, sometimes not. It
>raises an error "Invalid pointing operation/conversion". I debuged the
>program and saw that sometimes some of these operators are not with the
>values they should have. Once, one of these operators show the value "
> What I have to do ? Should I define these fields as another Interbase
>type instead DOUBLE PRECISION ? What is the most trustable type for
>floating values ? Am I using the better syntax in Delphi ? Please, help
>Thank you in advance,
>Paulo Albuquerque de Barros JĂșnior
>Need technology solutions for your business? can help.
>Just tell us your IT needs. We'll bring the right providers to you
>To unsubscribe from this group, send an email to:
"Ask not what your free, open-source database can do for you,
but what you can do for your free, open-source database."