Subject Re: [firebird-support] Re: NUMERIC and DECIMAL
Author Ann W. Harrison
zaher dirkey wrote:
> Can you get more explain how it fail.
>
> before i put the first message, i understand that DECIMAL(3,2) mean we
> have 3 digits before dot and 2 digits after, but NUMERIC(5,2) mean we
> have 5 digits included the 2 digits after the dot that mean NUMERIC
> (5,2) is like DECIMAL(3,2) is that true?

No. In both cases, the first number is the precision - the total number
of digits that can be represented - and the second is the number of
decimal digits.

And I too would be interested to know about problems with SUM. My
understanding is that it works differently in Dialect 1 and Dialect 3,
and that each could cause problems.

In Dialect 1, intermediate calculations are done in double precision,
leading to possible fuzziness in the tiny bits of fractions. Normally
that's a problem with division and perhaps multiplication - addition
shouldn't be affected - at least not after the result has been converted
back to a numeric/decimal value.

In Dialect 3, intermediate calculations are done in the input and output
types. That leads to different problems, especially with
multiplication and division overflowing the type. But adding ought to work.

Regards,


Ann