26 #define HALF_MIN 5.9604644775391E-08 // Smallest half number 27 #define HALF_MAX 65504.0 // Largest half number 28 #define HALF_EPSILON 0.00097656 // Smallest number where (1+e) != 1 38 static const FXushort fhb[512];
39 static const FXuchar fhs[512];
40 static const FXuint hfm[2048];
41 static const FXuint hfe[64];
42 static const FXushort hfw[64];
51 union { FXfloat f; FXuint u; } r={f};
52 v=fhb[(r.u>>23)&0x1ff]+((r.u&0x007fffff)>>fhs[(r.u>>23)&0x1ff]);
56 operator FXfloat()
const {
57 union { FXuint u; FXfloat f; } r={hfm[hfw[v>>10]+(v&0x3ff)]+hfe[v>>10]};
62 FXbool operator!()
const {
return v==0; }
65 FXhalf operator+()
const {
return *
this; }
66 FXhalf operator-()
const {
FXhalf h; h.v=v^0x8000;
return h; }
69 FXbool operator==(
FXhalf h)
const {
return v==h.v; }
70 FXbool operator!=(
FXhalf h)
const {
return v!=h.v; }
74 FXhalf& operator=(FXfloat f){ *
this=
FXhalf(f);
return *
this; }
78 FXhalf& operator+=(FXfloat f){ *
this=
FXhalf(FXfloat(*
this)+f);
return *
this; }
81 FXhalf& operator-=(FXfloat f){ *
this=
FXhalf(FXfloat(*
this)-f);
return *
this; }
84 FXhalf& operator*=(FXfloat f){ *
this=
FXhalf(FXfloat(*
this)*f);
return *
this; }
87 FXhalf& operator/=(FXfloat f){ *
this=
FXhalf(FXfloat(*
this)/f);
return *
this; }
Definition: FX4Splitter.h:28
Half float (16-bit float)
Definition: FXhalf.h:34