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

What does float mean in java?

藏色散人
Release: 2020-09-17 13:56:46
Original
17893 people have browsed it

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。
Copy after login

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!

Related labels:
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