sargon.halffloatImplement IEEE 754 half-precision binary floating point format binary16. This a 16 bit type, and consists of a sign bit, a 5 bit exponent, and a 10 bit significand. All operations on HalfFloat are CTFE'able. References:
Boost License 1.0 Authors:
Walter Bright Source:
- struct HalfFloat;
- The half precision floating point type.
The only operations are:
HalfFloat h = hf!27.2f; HalfFloat j = cast(HalfFloat)( hf!3.5f + hf!5 ); HalfFloat f = HalfFloat(0.0f);BUGS:
The only rounding mode currently supported is Round To Nearest. The exceptions OVERFLOW, UNDERFLOW and INEXACT are not thrown.
- template hf(float v)
- User defined literal for Half Float.
auto h = hf!1.3f;