+ -
当前位置:首页 → 问答吧 → Perl对长整数的处理时怎么样的啊?

Perl对长整数的处理时怎么样的啊?

时间:2011-04-30

来源:互联网

原因: 数据库中sqlite有一个列是Integer,里面存储的是18位的证书

用perl链接数据库以后的出来的是一个15位的用科学计数法表示的数

怎么获得正确的数呢?

多谢诸位大侠

作者: xzcg   发布时间: 2011-04-30

本帖最后由 longbow0 于 2011-04-30 18:50 编辑

use bigint;

不过根据 perldoc DBI,

Most data is returned to the Perl script as strings. (Null values are returned as undef.) This allows arbitrary precision numeric data to be handled without loss of accuracy. Beware that Perl may not preserve the same accuracy when the string is used as a number.

最好是提供具体代码。

作者: longbow0   发布时间: 2011-04-30

转换成字符串吗?

作者: 2gua   发布时间: 2011-04-30

热门下载

更多