1. Floating-point types are used to represent decimal data types.
2, floating point number principle: that is, the binary scientific counting method.
3. The floating-point type of Java has float and double two kinds.
4. The result of the Java default floating-point type calculation is a double type, and the literal is also a double type.
1, decimal floating point number scientific counting method: 219345 = 2.19345* (10^5)
2, binary floating point number scientific counting method: 10111 = 1.0111* (2^100)
1, Float type Total 32 bits, 1 bit is sign bit, exponent 8 bit, mantissa 23 bit.
2, float precision is 23 bits (that is, can accurately express the number of 23 bits, more than is intercepted).
Decimals are expressed in the mantissa length, such as the accuracy of pi=3.1415 is 4 bits.
3. Float stores data in a range larger than int, but with less precision than int because the precision of int is 31 bits.
1, double type, 1-bit sign bit, 11-bit exponent, 52-bit mantissa.
2, double range is much larger than long, but double precision is inferior to long.
Floating-point arithmetic is real arithmetic, because the computer can only store integers, so the real numbers are approximate, so floating-point arithmetic is very slow and there is error.
Placeholder Summary:
Character type: char:2 bytes
Integer: byte:1 bytes
Shot:2 bytes
Int:4 bytes
Long:8 bytes
Real: Float:4 bytes
Double:8 bytes
Boolean: Boolean: One-byte
One of these bytes consists of 8 bits
Java base floating-point types