手机
当前位置:查字典教程网 >编程开发 >php教程 >PHP中的float类型使用说明
PHP中的float类型使用说明
摘要:float类型的表示可以有以下几种:复制代码代码如下:使用PHP的float类型需要注意的是:PHP的float类型的精度有点问题。如果需要...

float类型的表示可以有以下几种:

复制代码 代码如下:

<?php

$a = 1.234;

$b = 1.2e3;

$c = 7E-10;

?>

使用PHP的float类型需要注意的是:PHP的float类型的精度有点问题。如果需要高精度的数学计算,可以使用php提供的专用的数学函数 arbitrary precision math functions系列和gmp系列函数。还有就是不要试图进行比较float类型的变量。

Converting to float

For information on converting strings to float, see String conversion to numbers. For values of other types, the conversion is performed by converting the value to integer first and then to float. See Converting to integer for more information. As of PHP 5, a notice is thrown if an object is converted to float.

不翻译了。呵呵

【PHP中的float类型使用说明】相关文章:

PHP中is_file()函数使用指南

在PHP中使用XML

PHP中iconv函数知识汇总

PHP中Session的概念

PHP中的一些常用函数收集

PHP中的超全局变量

PHP中foreach()用法汇总

PHP中的traits实现代码复用使用实例

PHP中is_dir()函数使用指南

理解 PHP 中的 Streams

精品推荐
分类导航