Subject RE: [firebird-support] numeric overflow with constants?
Author Alan McDonald
> Why does the following generate a numeric overflow, and how do I
> prevent it from doing so?
>
> select 0.65000000000000002 / 0.34999999999999998 from rdb$database;

select CAST(0.65000000000000002 AS NUMERIC(18,2)) / CAST(0.34999999999999998
AS NUMERIC(18,2)) from rdb$database;

will return answer in 4 decimal places
Alan

>
> The query is machine generated from internal floating point
> representations of .65 and .35 and I would like to know how to send
> it to FB so that the right thing happens.
>
> TIA
> ________________________________________________________
> Richard Wesley Software Engineer