Subject Re: [firebird-support] INTEGER BUG
Author Dimitry Sibiryakov
> Why do we get an integer overflow with this code:
>
> select
> cast(1.000 as numeric(18,10)) * 1.0000 * 1.000 * 1.0 * 1.0 from
> rdb$database

Because result has type numeric(18,19), where 19=10+4+3+1+1, that is
impossible.

> but not this one?
>
> select
> cast(1.000 as numeric(18,10)) * 1.0000 * 1.0 * 1.0 * 1.0 from
> rdb$database

Because 10+4+1+1+1 = 17. Numeric (18,17) is possible.

> This is a SERIOUS BUG!!

In your head only. Read about precise arithmetic in Dialect 3.

SY, SD.