php data type of float

 

The so-called floating-point type, can be understood as: We decimal math inside.

[Note] focus on the accuracy of the range and type of declaration is not science learning. Because this block is used in the actual development of particularly low. Our knowledge of this block is labeled as learning to understand the level. Linear motor slider

Disclaimer divided into two types:

General declaration

Scientific Statement

Ordinary floating-point statement

<? PHP 
// declare variables fudian value 12121.3132 
$ fudian = 12121.3132; 
echo $ fudian; 
?>
<? PHP 
// declare variable $ fl value of 0.8873 
$ fl = 0.8873; 
var_dump ($ fl); 
?>

We will save the file to the XAMPP htdocs directory, and save the file name: float.php. In the browser address bar, type: http: //127.0.0.1/float.php, take a look at the implementation of the results, as follows:

2015-07-26_55b4867a47de5.png

12121.3132 output direct echo, and outputs the var_dump 0.8873, also it shows the type of the variable $ FL as float.


var_dump () is a function. () Variables to the intermediate bracket is inserted. This function will print out the data type, length, and also the corresponding values ​​of the variables displayed.

var refers to the variable English: variable

Guess you like

Origin www.cnblogs.com/furuihua/p/12060678.html