This article introduces the integer type and floating point number of the PHP data type. For more information, see
Syntax: the integer value can be expressed in decimal, hexadecimal, or octal notation. An optional Symbol (-or +) can be added before ). The octal value indicates that 0 (zero) must be added before the number, and the hexadecimal value indicates that 0x must be added before the number.
$ Int1 = 100; // decimal
$ Int2 =-123; // negative number
$ Int3 = 0123; // eight bytes
$ Int4 = 0x1A; // hexadecimal number
EchoPHP_INT_SIZE; // Display an integer in several bytes
Echo"
";
EchoPHP_INT_MAX; Echo"
"; // The maximum number of Integers (2147483647)
$ Fmax = 2147483648;
Var_dump (PHP_INT_MAX );//A number that exceeds the integer Range is interpreted as the float type.
Echo"
";
Var_dump ($ fmax );
Floating Point Number: Floating Point Number (double precision or real number)
$ A = 1.34;
$ B = 1.8e308;
$ C = 8e-10;
Var_dump ($ B );
// The length of the floating point is related to the platform, although the maximum value is usually 1.8e308 and has 14 decimal digits (up to 14 digits)
//The accuracy is calculated from the first non-zero number starting from the left.
For example: $ a = 567.9999899 // output 567.9999899
$ B = 789.8812345678543 // output 789.88123456785
$ C = 0.000000008907777777 // output 0.000000008907777777
Important:Accuracy starts from the leftThe first non-zero numberComputing.