Subject Re: [IB-Architect] Floating pointing operations troubles
Author Helen Borrie
Paulo:
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:
>Hello,
>
> 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
>begin
> first;
> while not eof do
> begin
> Query2.ParamByName('codigo').asstring:=fieldbyname
>('IE_produto').asstring;
> Query2.prepare;
> Query2.open;
> 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.post;
> Query2.close;
> next;
> end;
>end;
>
> All the envolved fields in the above calculation are defined like
>DOUBLE PRECISION fields. I'm using two TIBQuery connected to two
>TIBUpdateSQL.
> 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 "
>-NAV".
> 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
>me...
>
>Thank you in advance,
>
>Paulo Albuquerque de Barros JĂșnior
>paulo.albuquerque@...
>
>
>
>------------------------------------------------------------------------
>
>Need technology solutions for your business? Respond.com can help.
>Just tell us your IT needs. We'll bring the right providers to you
>http://click.egroups.com/1/6324/6/_/830676/_/963325038/
>------------------------------------------------------------------------
>
>To unsubscribe from this group, send an email to:
>IB-Architect-unsubscribe@onelist.com
>

http://www.interbase2000.org
___________________________________________________
"Ask not what your free, open-source database can do for you,
but what you can do for your free, open-source database."
(J.F.K.)