开发者

Decimal type in php

开发者 https://www.devze.com 2023-01-07 10:11 出处:网络
Does PHP have Decimal(±1.0 × 10−28开发者_开发百科 to ±7.9 × 1028) data type?The BC Math extension implements arbitrary-precisiondecimal math:

Does PHP have Decimal(±1.0 × 10−28开发者_开发百科 to ±7.9 × 1028) data type?


The BC Math extension implements arbitrary-precision decimal math:

$a = '0.1';
$b = '0.2';
echo bcadd($a, $b);     // prints 0.3

(From The Floating-Point Guide)

0

精彩评论

暂无评论...
验证码 换一张
取 消