$ perl -e '
$v = 2003706389.58126306*1.003833698;
print $v, "\n";
'
2011387994.75959
$
perl里怎么设置浮点数精度呢?谢谢。
--
[32m◢◣ [0;1;36;40m。 [0;32;40m◢◣ [0;1;36;40m。 [0;37;40m
[32m◢ [0;1;33;40m★ [0;32;40m◣ [0;1;36;40m。 [0;32;40m◢ [0;1;36;40m★ [0;32;40m◣ [0;1;36;40m。 [0;37;40m
[32m◢■■◣ [0;1;36;40m。 [0;32;40m◢■■◣ [0;1;36;40m。 [0;37;40m
[32m◢■■■◣ [0;1;36;40m。 [0;32;40m◢■■■◣ [0;1;36;40m。 [0;37;40m
[33m﹋﹋║﹋﹋ [0;1;33;40m﹗﹗ [0;33;40m﹋﹋║﹋﹋ [0;1;36;40m愿你有快乐的每一天 ^_^!!
[m [1;33m※ 来源:·水木社区 newsmth.net·[FROM: 114.255.167.*] [m
【 在 flyhighxu (FRM - Financial Risk Manager) 的大作中提到: 】
: 如下所示,输入的数,小数点后有8-9位,输出的数,小数点后只保留5位。
: $ perl -e '
: $v = 2003706389.58126306*1.003833698;
: ...................
--
Where there is form, already there is emptiness.
Where there is emptiness, already there is form.
All composite things pass away.
Strive for your own liberation with diligence.
[m [1;33m※ 来源:·水木社区 newsmth.net·[FROM: 202.106.180.*] [m
【 在 Invader (政治局局长 || Real Communist) 的大作中提到: 】
: 标 题: Re: perl里怎么设置浮点数精度?
: 发信站: 水木社区 (Mon Aug 16 16:24:02 2010), 转信
:
: use bignum;
--
[32m◢◣ [0;1;36;40m。 [0;32;40m◢◣ [0;1;36;40m。 [0;37;40m
[32m◢ [0;1;33;40m★ [0;32;40m◣ [0;1;36;40m。 [0;32;40m◢ [0;1;36;40m★ [0;32;40m◣ [0;1;36;40m。 [0;37;40m
[32m◢■■◣ [0;1;36;40m。 [0;32;40m◢■■◣ [0;1;36;40m。 [0;37;40m
[32m◢■■■◣ [0;1;36;40m。 [0;32;40m◢■■■◣ [0;1;36;40m。 [0;37;40m
[33m﹋﹋║﹋﹋ [0;1;33;40m﹗﹗ [0;33;40m﹋﹋║﹋﹋ [0;1;36;40m愿你有快乐的每一天 ^_^!!
[m [1;33m※ 来源:·水木社区 newsmth.net·[FROM: 114.255.167.*] [m