Subject Re: [firebird-support] Re: Numeric Calculation Error ?
Author Sibylle Koczian
At 10:49 14.01.2005, you wrote:


>Sorry, I don't care about the figure after decimal point , but the
>major problem is the integer part -230930 and 4984.
>
>1. The correct result should be positive but the first result is
>netagive.

But your first SELECT _must_ have a negative result:

> >> > select 0.00 - (13060.45*9.031631) - (13060.45*8.65) from
>RDB$DATABASE
> > >> >

Is the first "-" a typo? If yes: only in the mail or in your application or
wherever you got these two results?

> > >> > the wrong result is -230930.057593950041
> > >> >
> > >> > but
> > >> >
> > >> > select 0.00 + (13060.45*9.031631) - (13060.45*8.65) from
>RDB$DATABASE
> > >> >
> > >> > get correct result is 4984.2725939500006
> > >> >

yes, because in this case the first operator is +, not -.

I hope I didn't greatly misunderstand SELECT ... FROM RDB$DATABASE: in this
case it _is_ supposed simply to do the calculation and give back the result?

HTH
Sibylle


Dr. Sibylle Koczian
Universitaetsbibliothek, Abt. Naturwiss.
D-86135 Augsburg

Tel.: (0821) 598-2400, Fax : (0821) 598-2410
e-mail : Sibylle.Koczian@...-Augsburg.DE