Half class

A 16-bit floating-point number, used by high-dynamic-range image formats as a more efficient storage for floating-point values that don't require full 32-bit precision. A list of Half floats can be stored in a Uint16List, and converted to a double using the HalfToDouble static method.

This class is derived from the OpenEXR library.

Constructors

Half([num? f])
Half.fromBits(int bits)

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

bits() int?
isDenormalized() bool
Returns true if h is a denormalized number.
isFinite() bool
Returns true if h is a normalized number, a denormalized number or zero.
isInfinity() bool
Returns true if h is a positive or a negative infinity.
isNan() bool
Returns true if h is a NAN.
isNegative() bool
Returns true if the sign bit of h is set (negative).
isNormalized() bool
Returns true if h is a normalized number.
isZero() bool
Returns true if h is zero.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
round(int n) Half
Round to n-bit precision (n should be between 0 and 10). After rounding, the significand's 10-n least significant bits will be zero.
setBits(int bits) → void
toDouble() double
toString() String
A string representation of this object.
inherited

Operators

operator *(dynamic f) Half
operator +(dynamic f) Half
Addition operator for Half or num left operands.
operator -(dynamic f) Half
Subtraction operator for Half or num left operands.
operator /(dynamic f) Half
operator ==(Object other) bool
The equality operator.
inherited
operator unary-() Half
Unary minus

Static Methods

DoubleToHalf(num n) int
HalfToDouble(int bits) double
negInf() Half
Returns -infinity.
posInf() Half
Returns +infinity.
qNan() Half
Returns a NAN with the bit pattern 0111111111111111.
sNan() Half
Returns a NAN with the bit pattern 0111110111111111.