HalfFloat

The half precision floating point type.

The only operations are:

  • explicit conversion of float to HalfFloat
  • implicit conversion of HalfFloat to float

It operates in an analogous manner to shorts, which are converted to ints before performing any operations, and explicitly cast back to shorts. The half float is considered essentially a storage type, not a computation type.

Constructors

this
this(T f)
Undocumented in source.

Alias This

toFloat

Members

Manifest constants

dig
enum dig;
mant_dig
enum mant_dig;
max_10_exp
enum max_10_exp;
max_exp
enum max_exp;
min_10_exp
enum min_10_exp;
min_exp
enum min_exp;

Properties

epsilon
HalfFloat epsilon [@property getter]
infinity
HalfFloat infinity [@property getter]
max
HalfFloat max [@property getter]
min_normal
HalfFloat min_normal [@property getter]
nan
HalfFloat nan [@property getter]
toFloat
float toFloat [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.

Bugs

The only rounding mode currently supported is Round To Nearest. The exceptions OVERFLOW, UNDERFLOW and INEXACT are not thrown.

Examples

HalfFloat h = hf!27.2f;
HalfFloat j = cast(HalfFloat)( hf!3.5f + hf!5 );
HalfFloat f = HalfFloat(0.0f);

Meta