Subject Re: [firebird-support] numeric overflow with constants?
Author Richard Wesley
On Jun 1, 2006, at 15:28, Alan McDonald wrote:

>> 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;

The solution we came up with is similar:

select CAST(0.65000000000000002 AS double precision) / CAST
AS double precision) from rdb$database;

I guess my question is "Why?" Or more precisely, "What is the the
implied type of these constants without casting?"
Richard Wesley Software Engineer
Tableau Software hawkfish
tableausoftware com