This article introduces the integer type and floating point number of the PHP Data type. If you need a friend, refer to the following syntax: the integer value can be expressed in decimal, hexadecimal or octal notation. you can add an optional symbol (-or +) to the front ). 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
Echo PHP_INT_SIZE; // display an integer in several bytes
Echo"
";
Echo PHP_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 starts from the first non-zero number on the left.
For example: $ a = 567.9999899 // output 567.9999899
$ B = 789.8812345678543 // output 789.88123456785
$ C = 0.000000008907777777 // output 0.000000008907777777
Important: The accuracy starts from the left side of the first non-0 numeric calculation.