A 16-bit floating point number. More...
#include <half.h>
Public Member Functions | |
half () | |
Constructs an uninitialized half. | |
half (float x) | |
Constructs a half from a 32-bits floating point value. | |
float | toFloat () const |
Converts to a 32-bits floating point value. | |
operator float () const | |
Overloaded float cast (allows to write: float x = half). | |
half | operator== (const half v) const |
Equality. | |
bool | operator!= (const half v) const |
Difference. | |
half | operator+ (const half v) const |
Addition. | |
half | operator- (const half v) const |
Subtraction. | |
half | operator* (const half v) const |
Multiplication. | |
half | operator/ (const half v) const |
Divide. | |
bool | isNaN () const |
Test for NaN. | |
bool | isFinite () const |
Test for not (NaN or infinity). | |
bool | isInf () const |
Test for infinity. | |
bool | isNormal () const |
Test for non-denormals. |
A 16-bit floating point number.
Contains 1 sign bit, 5 biased exponent bit, and 10 mantissa bits.
ork::half::half | ( | ) | [inline] |
Constructs an uninitialized half.
ork::half::half | ( | float | x | ) | [inline] |
bool ork::half::isFinite | ( | ) | const [inline] |
Test for not (NaN or infinity).
bool ork::half::isInf | ( | ) | const [inline] |
Test for infinity.
bool ork::half::isNaN | ( | ) | const [inline] |
Test for NaN.
bool ork::half::isNormal | ( | ) | const [inline] |
Test for non-denormals.
ork::half::operator float | ( | ) | const [inline] |
Overloaded float cast (allows to write: float x = half).
bool ork::half::operator!= | ( | const half | v | ) | const [inline] |
Difference.
float ork::half::toFloat | ( | ) | const [inline] |
Converts to a 32-bits floating point value.