You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to IEEE_754 and its explanation, double precision must support storage of ~2.2250738585072009e-308 ("largest subnormal number") which is repsesented as: [bin] 0 00000000000 1111111111111111111111111111111111111111111111111111
But this is not so in FB 4.x ... 6.x for value 2.2250738585072013e-308 which is greater than above mentioned limit.
Consider script:
set sqlda_display on;
select
2.2250738585072014e-308 as near_zero_1 ---------------- [ 1 ]
from rdb$database;
select 2.2250738585072013e-308 as near_zero_2 ------------ [ 2 ]
from rdb$database;
select cast('2.2250738585072013e-308' as double precision) as near_zero_3 ---- [ 3 ]
from rdb$database;
Statement "[ 1 ]" will pass OK.
Statement "[ 2 ]" will also pass but shows
01: sqltype: 480 DOUBLE scale: 0 subtype: 0 len: 8
: name: CAST alias: NEAR_ZERO_3
: table: schema: owner:
Statement failed, SQLSTATE = 22003
arithmetic exception, numeric overflow, or string truncation
-numeric value is out of range
IMO, attempt to store values [ 2.2250738585072009e-308 ... 2.2250738585072013e-308 ] (including bounds) must cause them be truncated to zero nor raise exception.