Half

Class of android.util · Half.java · Android's reference

public final class Half extends Number implements Comparable<Half>

An IEEE 754 binary16 value: 1 sign bit, 5 exponent bits, 10 mantissa bits.

Fields

public static final int SIZE = 16 source
public static final short EPSILON = 0x1400 source
public static final short LOWEST_VALUE source
public static final short MAX_VALUE = 0x7bff source
public static final short MIN_NORMAL = 0x0400 source
public static final short MIN_VALUE = 0x0001 source
public static final short NaN = 0x7e00 source
public static final short NEGATIVE_INFINITY source
public static final short NEGATIVE_ZERO source
public static final short POSITIVE_INFINITY = 0x7c00 source
public static final short POSITIVE_ZERO = 0x0000 source
public static final int MAX_EXPONENT = 15 source
public static final int MIN_EXPONENT = -14 source

Constructors

public Half(short value) source
public Half(float value) source
public Half(double value) source
public Half(String s) throws NumberFormatException source

Methods

public static Half valueOf(short h) source
public static Half valueOf(float f) source
public static Half valueOf(String s) source
public short halfValue() source
public byte byteValue() source
public short shortValue() source
public int intValue() source
public long longValue() source
public float floatValue() source
public double doubleValue() source
public boolean isNaN() source
public static boolean isNaN(short h) source
public static boolean isInfinite(short h) source
public static int halfToIntBits(short h) source
public static int halfToRawIntBits(short h) source
public static short intBitsToHalf(int bits) source
public static float toFloat(short h) source

The float of a half, exactly: each half value is a float value.

public static short toHalf(float f) source

The nearest half of a float, ties to even. A NaN stays a NaN, and a value too large becomes infinity.

public static String toString(short h) source
public static int compare(short x, short y) source

As Float.compare: -0 is less than +0, and NaN is greater than each other value.

public int compareTo(Half h) source
public boolean equals(Object o) source
public int hashCode() source
public String toString() source

Made from ScarletNX's Sail at 166ad3910f80. The framework is ScarletNX's (GPL-3.0-or-later); the parts that follow the Android Open Source Project's sources (Apache-2.0) say so in their files.