From: Gabriel J. <gj...@co...> - 2003-06-27 08:17:55
|
Hi List! I have a serious problem in computations in Firebird 1.5: First my environment: Firebird 1.5 Release Candidate 3 WI-T1.5.0.3481 Superserver on Windows XP Home Edition Processor: Athlon XP 1700 I discovered the problem in a stored procedure but I can replicate the problem in the following query: select 5655555.0000 * 32900.0000 from RDB$DATABASE Result: Unsuccessful execution caused by system error that does not preclude sccessful execution of subsequent statements. Integer overflow. The result of an integer operation caused the most significant bit of the result to carry. The same result for queries: select cast(5655555 as numeric(18,4)) * cast(32900 as numeric(18, 4)) from RDB$DATABASE select cast(5655555.0000 * 32900.0000 as numeric(18, 4)) from RDB$DATABASE But for queries: select 5655555.000 * 32900.000 from RDB$DATABASE select cast(5655555 as numeric(18,3)) * cast(32900 as numeric(18, 3)) from RDB$DATABASE I get the result: 186,067,759,500.000032 !!! (obviously wrong) In the stored procedure where I noticed this behavior, I have 3 local variables of type numeric(18,4) and I get the above error in a simple multiply operation: v2 = 5655555; v3 = 32900; v1 = v2 * v3; What am I doing wrong? Or is it a bug in Firebird? Regards, Gabriel Juncu |