Module java.base
Package java.lang

# Class Float

≠
public final class Float
extends java.lang.Number
implements java.lang.Comparable<java.lang.Float>, java.lang.constant.Constable, java.lang.constant.ConstantDesc
Comparing jdk-master and valhalla-csr-open

All Implemented Interfaces:
  `Serializable, Comparable<Float>, Constable, ConstantDesc`

public final class Float extends Number implements Comparable<Float>, Constable, ConstantDesc
The `Float` class is the wrapper class for values of the primitive type `float` . An object of type `Float` contains a single field whose type is `float` .

In addition, this class provides several methods for converting a `float` to a `String` and a `String` to a `float` , as well as other constants and methods useful when dealing with a `float` .

This is a value-based class; programmers should treat instances that are equal as interchangeable and should not use instances for synchronization, or unpredictable behavior may occur. For example, in a future release, synchronization may fail mutexes, or with object references.

When preview features are enabled, `Float` is a value classPREVIEW . Use of value class instances for synchronization, mutexes, or with object references result in `IdentityException` PREVIEW Moved out of a paragraph.Moved to a division with class preview-block.Moved to a division with class preview-comment..

## Floating-point Equality, Equivalence, and Comparison

The class `java.lang.Double` has a discussion of equality, equivalence, and comparison of floating-point values that is equally applicable to `float` values.

## Decimal ↔ Binary Conversion Issues

The discussion of binary to decimal conversion issues in `java.lang.Double` is also applicable to `float` values.

Since:
  1.0
External Specifications
  - IEEE Standard for Floating-Point Arithmetic
See Also:
  - Serialized Form

## Fields

- =
  public static final int BYTES = 4
- =
  public static final int MAX_EXPONENT = 127
- =
  public static final float MAX_VALUE = 3.4028235E38
- =
  public static final int MIN_EXPONENT = -126
- =
  public static final float MIN_NORMAL = 1.1754944E-38
- =
  public static final float MIN_VALUE = 1.4E-45
- =
  public static final float NEGATIVE_INFINITY = -Infinity
- =
  public static final float NaN = NaN
- =
  public static final float POSITIVE_INFINITY = Infinity
- =
  public static final int PRECISION = 24
- =
  public static final int SIZE = 32
- =
  public static final java.lang.Class<java.lang.Float> TYPE

## Constructors

- =
  @Deprecated(since="9")
  public Float(float arg0)
- =
  @Deprecated(since="9")
  public Float(double arg0)
- =
  @Deprecated(since="9")
  public Float(java.lang.String arg0) throws java.lang.NumberFormatException

## Methods

- =
  public byte byteValue()
- =
  public static int compare(float arg0, float arg1)
- =
  public int compareTo(java.lang.Float arg0)
- =
  public java.util.Optional<java.lang.Float> describeConstable()
- =
  public double doubleValue()
- =
  public boolean equals(java.lang.Object arg0)
- =
  public static float float16ToFloat(short arg0)
- =
  public static short floatToFloat16(float arg0)
- =
  public static int floatToIntBits(float arg0)
- =
  public static int floatToRawIntBits(float arg0)
- =
  public float floatValue()
- =
  public int hashCode()
- =
  public static int hashCode(float arg0)
- =
  public static float intBitsToFloat(int arg0)
- =
  public int intValue()
- =
  public static boolean isFinite(float arg0)
- =
  public boolean isInfinite()
- =
  public static boolean isInfinite(float arg0)
- =
  public boolean isNaN()
- =
  public static boolean isNaN(float arg0)
- =
  public long longValue()
- =
  public static float max(float arg0, float arg1)
- =
  public static float min(float arg0, float arg1)
- =
  public static float parseFloat(java.lang.String arg0) throws java.lang.NumberFormatException
- =
  public java.lang.Float resolveConstantDesc(java.lang.invoke.MethodHandles.Lookup arg0)
- =
  public short shortValue()
- =
  public static float sum(float arg0, float arg1)
- =
  public static java.lang.String toHexString(float arg0)
- =
  public java.lang.String toString()
- =
  public static java.lang.String toString(float arg0)
- =
  public static java.lang.Float valueOf(float arg0)
- =
  public static java.lang.Float valueOf(java.lang.String arg0) throws java.lang.NumberFormatException

## Serialized Form

=

### serialVersionUID

=-2671257302660747028

### Serialized Fields

- =
  float value

## Summary

Differences
| Elements | Comments | Descriptions | Total
Added | Changed | Removed | Added | Changed | Removed | Added | Changed | Removed
--- | --- | --- | --- | --- | --- | --- | --- | ---
Float |  |  |  |  |  |  | 7 | 2 |  | 9
Total |  |  |  |  |  |  | 7 | 2 |  | 9