Subject Re: [firebird-support] Re: Error in stored procedure. Why? (more)
Author Aage Johansen
Paco Ruiz wrote:

> This line raises an error
>> DS = (1 - D1/100) * (1 - D2/100) * (1 - D3/100) * (1 - D4/100) ;
>
>
> This two lines works fine
> DS = (1 - D1/100) * (1 - D2/100) * (1 - D3/100) ;
> DS = DS * (1 - D4/100) ;


The 'precision' adds up as you go along. Your Numerics (18,6) when
multiplied will become (18,12) and then (18,18) and then booom!
Rewrite the expression into smaller parts so the intermediate results can
be kept 'within reason'.


--
Aage J.