PHP data type floating point type

The so-called floating point type can be understood as: the decimal in our mathematics.

[Note] Precision, value range and scientific statements are not the focus of learning. Because this block is rarely used in actual development. We label the learning of knowledge points in this block as the understanding level.

There are two declaration methods:

Common declaration

Scientific declaration

Common declaration of floating point number

We will save the file Go to the htdocs directory of XAMPP and save the file name: float.php. In the browser address bar, enter: http://127.0.0.1/float.php, execute it and see the results, as follows:

2015-07-26_55b4867a47de5.png

echo directly outputs 12121.3132, and var_dump The output is 0.8873, and it also shows that the type of variable $fl is float.


var_dump() is a function. Insert variables between brackets (). This function will print out the data type and also display the length and value of the variable accordingly.

var refers to the English word for variable: variable
floatPronunciation: [floʊt]
Chinese explanation: Floating point type in computers

variablePronunciation: [ˈveriəbl]
Chinese explanation: variable

dumpPronunciation: [dʌmp]
Chinese explanation: dump; dump;


Continuing Learning
||
submit Reset Code
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!