Instructions for using float type in PHP_PHP tutorial

WBOY
Release: 2016-07-21 15:36:06
Original
726 people have browsed it

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

www.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...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!