Home > Backend Development > PHP Tutorial > Detailed introduction to floating point type (Float)

Detailed introduction to floating point type (Float)

零下一度
Release: 2023-03-08 17:02:02
Original
8384 people have browsed it

What is a floating point (float) data type? Floating point data types are our common decimals. Think "0.7" and "100.2", these are all floating point data. Floating point data types can be used to store both integers and decimals. It has higher precision than the integer data type we talked about earlier. The valid range of floating point type is 1.8E-308~1.8E+308. Before PHP 4.0, the floating-point type was identified as double, also called double-precision floating-point number. There was no difference between the two. Floating-point data has two writing formats by default, one is the standard format, as follows 3.1415 -35.8 There is also a scientific notation format 3.14*10^3 You can use 3.14e3 to represent the floating point (float) data type example In the following example, we will test different numbers. PHP var_dump() will return the data type and value of the variable: "; $x&nb

1. php: Detailed explanation of floating point (float) data type examples

Detailed introduction to floating point type (Float)

Introduction: Floating point data types are our common decimals. Think of "0.7" and "100.2". These are floating point data. Floating point data types can be used to store both integers and integers. decimal. It has higher precision than the integer data type we talked about earlier. The valid range of floating point type is 1.8E-308~1.8E+308.

2. Analysis of PHP data type floating point type (Float)

Detailed introduction to floating point type (Float)

Introduction: Floating point type (also called floating point number float, double precision number double or real number real) can be defined with any of the following syntax: Floating point number representation: LNUM ...

3. php floating point type (Float)

Detailed introduction to floating point type (Float)

Introduction: Floating point numbers have limited precision. Although it depends on the system, PHP usually uses the IEEE 754 double format, so the maximum relative error due to rounding is 1.11e-16. Non-basic mathematical operations may give larger errors, and error propagation when doing compound operations needs to be taken into account.

4. PHP determines character type What are the PHP data types?

Introduction: PHP determines character type: PHP determines character type What are the PHP data types? : There are three major categories: 1. Basic data type: integer type (integer), which can be positive or negative integer decimal, octal, hexadecimal; floating point type (float), string type (string), Boolean type (boolean) , 2. Composite data type: array (array) object (object) 3. Special data type: null () resource type (resource) Note: 1> A variable is considered NULL in the following circumstances: assigned to NULL. Not yet assigned. is unset().

5. Data types in PHP (1)_PHP tutorial

Introduction: Data types in PHP ( 1). PHP supports eight primitive types. Four scalar types: boolean, integer, float (floating point number, also called "double"), string, two types

6. PHP supports 8 primitive types

#Introduction: PHP supports 8 primitive types PHP supports eight primitive types. Four scalar types: boolean - true or fasle Both are case-insensitive integers (integer) - 32-bit system, range: -2 147 483 648 ~ +2 147 483 647 floating point Type (float) (floating point number, also called "double") - 32-bit system, range: 1.7E-308~

7. PHP supports 8 primitive types

Introduction: PHP supports eight primitive types PHP supports eight primitive types. Four scalar types: boolean - true or fasle Both are case-insensitive integers (integer) - 32-bit system, range: -2 147 483 648 ~ +2 147 483 647 floating point Type (float) (floating point number, also called "double") - 32-bit system, range: 1.7E-308~1

8. Data types in PHP (1)

Introduction: Data types in PHP (1). PHP supports eight primitive types. Four scalar types: boolean, integer, float (floating point number, also called "double"), string, two types

9. php data type 01

Introduction: 1. Data type: Scalar type: int, float, string, boolean Compatible types: array, object Other types: resource ,NULL 2. $a = 123; echo 11$a; //$a can be typed echo 11$a11; //$a cannot be typed, PHP defaults to $a11 being one

The above is the detailed content of Detailed introduction to floating point type (Float). For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template