The representation of float type can be as follows:
Copy code The code is as follows:
$ a = 1.234;
$b = 1.2e3;
$c = 7E-10;
?>
What you need to pay attention to when using PHP’s float type is: PHP’s There is a problem with float type accuracy. If you need high-precision mathematical calculations, you can use the arbitrary precision math functions series and gmp series of functions provided by PHP. Also, don't try to compare float type variables.
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.
is not translated. hehe
http://www.bkjia.com/PHPjc/322193.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/322193.htmlTechArticleThe representation of float type can be as follows: Copy the code as follows: ?php $a = 1.234; $b = 1.2e3; $c = 7E-10; ? What you need to pay attention to when using PHP's float type is: the precision of PHP's float type...