Calculated value - PHP calculation method
仅有的幸福
仅有的幸福 2017-05-16 13:09:38
0
1
407
What are the general methods of using PHP operations?

For example, it is used when calculating turnover
$sql = "select sum(`price`) from table";
$cprice = $dosql($sql);

//When cprice * 100 is found, the result type is float
It is said that float is not suitable for calculations. Will it have any impact? 
仅有的幸福
仅有的幸福

reply all(1)
洪涛

It is best to use the int type, which is accurate to minutes when defining. Single-precision floating-point numbers use 4 bytes (32 bits) to represent floating-point numbers.
Use IEEE754 standard computer floating-point numbers, which are represented internally in binary. For example: 7.22 is expressed in 32 bits. There is no way to express it in binary.
So it’s not accurate.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template