DECFLOAT: subtraction Num1 - Num2 leads to "Decimal float overflow" if Num2 is specified in scientific notation and less than max double ( 1.7976931348623157e308 ) -------------------------------------------------------------------------------------------------------------------------------------------------------------------
Key: CORE-6238 URL: http://tracker.firebirdsql.org/browse/CORE-6238 Project: Firebird Core Issue Type: Bug Components: Engine Reporter: Pavel Zotov Example-1: ========= SQL> select (d -1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) from (select 9.999999999999999999999999999999998E+6144 d from rdb$database); Result: 9.999999999999999999999999999999998E+6144 // OK, Expected Example-2: ========= SQL> select (d - 1e0) from (select 9.999999999999999999999999999999998E+6144 d from rdb$database); Result: Statement failed, SQLSTATE = 22003 Decimal float overflow. The exponent of a result is greater than the magnitude allowed. PS. It seems that MINIMAL abs value in scientific notation that can be subtracted from 9.99e+6144 is 0x 7FEF FFFF FFFF FFFF, i.e. 1.7976931348623157e308 (max double): SQL> select (d-1.79769314e308) from (select 9.999999999999999999999999999999998E+6144 d from rdb$database); 9.999999999999999999999999999999998E+6144 === vs === SQL> select (d-1.79769313e308) from (select 9.999999999999999999999999999999998E+6144 d from rdb$database); Statement failed, SQLSTATE = 22003 Decimal float overflow. The exponent of a result is greater than the magnitude allowed. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://tracker.firebirdsql.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel