I have a table with a FLOAT
column, as defined in Oracle docs.
I insert a number with 52 binary digits (not counting the initial 1 which is implicit), yet I see that oracle requires only 50 digits to correctly store it. How could that be?
create table numeric_types2(
f1 float(60)
);
insert into numeric_types2 SELECT BIN_TO_NUM(
1,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,1
) FROM DUAL;
and then:
select to_char(cast(f1 as float(49)), 'XXXXXXXXXXXXXXXXX'),
to_char(cast(f1 as float(50)), 'XXXXXXXXXXXXXXXXX'),
to_char(cast(f1 as float(51)), 'XXXXXXXXXXXXXXXXX')
from root.numeric_types2;
return:
10000000000004, 10000000000001, 10000000000001
why is that? am i missing some elementary floating-point math?