Home>Article>Java> What does float mean in java?

What does float mean in java?

藏色散人
藏色散人 Original
2019-05-22 15:28:30 17778browse

float means "floating", which is a floating-point data type in Java. It is used to store single-precision floating-point numbers. The default value is "0.0f". The memory is allocated 4 bytes, occupying 32 bits. , 6-7 valid decimal places. float can save memory space when storing large floating point arrays; floating point numbers cannot be used to represent precise values, such as currencies.

What does float mean in java?

What does float mean in java?

The meaning of float in java: float is a single-precision floating point number, with 4 bytes of memory allocated, occupying 32 bits, and 6-7 effective decimal places.

float data type is a single-precision, 32-bit floating point number that complies with the IEEE 754 standard;

float can save memory space when storing large floating point arrays;

The default value is 0.0f;

Floating point numbers cannot be used to represent precise values, such as currency;

Example:

float f1 = 234.5f。

Note: Computer systems adopt so-called floating point numbers way of expression. This expression uses scientific notation to express real numbers, that is, it uses a mantissa (also called a significant figure), a base (Base), an exponent (Exponent), and a symbol to express positive and negative numbers. Floating point numbers use exponents to achieve the effect of floating decimal points, which can flexibly express a wider range of real numbers.

float: 1 bit (sign bit), 8 bits (exponent bit), 23 bits (mantissa bit)

The above is the detailed content of What does float mean in java?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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
Previous article:How to create javabean Next article:How to create javabean