Subject Re: [firebird-support] FB 2.1.3 Error: The result of an integer operation caused the most significant bit of the result to carry.
Author Sofija Blazevski
Srdačan pozdrav,
*Sofija Blaževski*
Software Developer

Grappolo International
www.grappologroup.com <http://www.grappologroup.com>



Dimitry Sibiryakov wrote:
>> I'm not sure why do I get this message "The result of an integer
>> operation caused the most significant bit of the result to carry."
>> I'm using FB 2.1.3
>>
>> This is the line that raises exception:
>>
>> V_DIFF = - V_AMOUNT * V_SIGN * V_RATE;
>>
>> These are declarations
>>
>> declare variable v_sign numeric(18,2);
>> declare variable v_diff numeric(18,2);
>> declare variable v_rate numeric(18,10);
>> declare variable v_amount numeric(18,2);
>>
>
> numeric(18,2)*numeric(18,2)*numeric(18,10) = numeric(18,14).
>
>
>> Using
>>
>> CAST((V_AMOUNT * V_SIGN * V_RATE) as numeric(18,2)
>>
>> doesn't help
>>
>
> Cast result of one multiplication.
>

Thank you Dimitry, that helped.

> SY, SD.
>
>
> ------------------------------------
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>
> Visit http://www.firebirdsql.org and click the Resources item
> on the main (top) menu. Try Knowledgebase and FAQ links !
>
> Also search the knowledgebases at http://www.ibphoenix.com
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> Yahoo! Groups Links
>
>
>
>