Subject Re: 3 * 1/3 = 0 ???
Author alex_vnru
--- In ib-support@y..., "Martijn Tonies" <m.tonies@u...> wrote:
> Dialect 3 has this behaviour - as defined - and it should have,
according
> to the SQL standard.

Hi, All. Martijn, IMHO this is the case where standard bother to
live. Especially in FB 3d with it's relatively low max precision for
numerics, integers are particular case of the problem:

N(18,2)/*USD*/ * D(18,6)/*rate*/ = D(18,8)

10 digits is not so much at least for countries with currency rate far
from 1 :), overflow of intermediate result became eternal menace. Even
in MSSQL with it's max precision 38 when a result precision is greater
than 38, the corresponding scale is reduced (limit is 6) to prevent
the integral part of a result from being truncated/overflow exception
raised. BTW, in last (experimental) Yaffil builds there is config
parameter which force scale of intermediate result to be max(operand's
scale) +1.

Best regards, Alexander V.Nevsky.