The float type can be represented in the following ways:
Copy CodeThe code is as follows:
$a = 1.234;
$b = 1.2e3;
$c = 7E-10;
?>
The type of float used in PHP needs to be noted: the accuracy of the float type of PHP is somewhat problematic. If you need high-precision mathematical calculations, you can use the dedicated math functions provided by PHP arbitrary precision math Functions series and GMP series functions. There is no attempt to compare variables of type float.
Converting to float
For information on converting strings to float, see String conversion to numbers. For values of other types, the conversion are 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 was converted to float.
Not translated. Oh
http://www.bkjia.com/PHPjc/322193.html www.bkjia.com true http://www.bkjia.com/PHPjc/322193.html techarticle the float type can be represented in the following ways: The copy code code is as follows: PHP $a = 1.234; $b = 1.2e3; $c = 7E-10;? The type of float used in PHP needs to be noted: the accuracy of the float type of PHP ...