LightDB23.3 支持binary_float/binary_double

LightDB23.3 支持binary_float/binary_double

LightDB 从 23.3 版本开始在 oracl e模式下支持 oracle 的 binary_float 和 binary_double。都遵循IEEE754标准。

示例

lightdb@test_o=# create table t1(key1 binary_float);
CREATE TABLE
lightdb@test_o=# \d+ t1
                                       Table "public.t1"
 Column |     Type      | Collation | Nullable | Default | Storage | Sta
ts target | Description 
--------+---------------+-----------+----------+---------+---------+----
----------+-------------
 key1   | binary_float |           |          |         | plain   |    
          | 
Access method: heap
lightdb@test_o=# insert into t1 values(123456789012345678901234567890123456789);
INSERT 0 1
lightdb@test_o=# insert into t1 values('infinity');
INSERT 0 1
lightdb@test_o=# insert into t1 values('NaN');
INSERT 0 1
lightdb@test_o=# select * from t1;
     key1      
---------------
 1.2345679e+38
      Infinity
           NaN
(3 rows)

lightdb@test_o=# create table t1(key1 binary_double);
CREATE TABLE
lightdb@test_o=# \d+ t1
                                       Table "public.t1"
 Column |     Type      | Collation | Nullable | Default | Storage | Sta
ts target | Description 
--------+---------------+-----------+----------+---------+---------+----
----------+-------------
 key1   | binary_double |           |          |         | plain   |    
          | 
Access method: heap
lightdb@test_o=# insert into t1 values(123456789012345678901234567890123456789);
INSERT 0 1
lightdb@test_o=# insert into t1 values('infinity');
INSERT 0 1
lightdb@test_o=# insert into t1 values('NaN');
INSERT 0 1
lightdb@test_o=# select * from t1;
          key1          
------------------------
 1.2345678901234568e+38
               Infinity
                    NaN
(3 rows)

Note

LightDB 的binary_float/binary_double 与oracle的binary_float/binary_double在内存中表示相同, 但查询出来的显示不同。

比如:123456789012345678901234567890123456789,在内存上表示的都是1.2345678605116651e+38,但oracle 显示为1.23456786E38,lightdb 显示为1.2345679e+38,精度不同。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

紫无之紫

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值