24 #ifndef __SHORT_FLOAT_H__
25 #define __SHORT_FLOAT_H__
42 #define SHORTVEC(V,A,B,C) short_float V[3] = {shortFromFloat(A),shortFromFloat(B),shortFromFloat(C)}
43 #define SHORT_VCP(V,A) {float *a=(float *)(A);short_float *v=(short_float *)(V); \
44 v[0]=shortFromFloat(a[0]);\
45 v[1]=shortFromFloat(a[1]);\
46 v[2]=shortFromFloat(a[2]);}
47 #define FLOAT_VCP(V,A) {float *v=(float *)(V);short_float *a=(short_float *)(A); \
48 v[0]=floatFromShort(a[0]);\
49 v[1]=floatFromShort(a[1]);\
50 v[2]=floatFromShort(a[2]);}
60 static inline short_float shortFromFloat(
const float external_ff) {
65 c.as_float = external_ff;
66 return basetable[(c.as_uint32>>23)&0x1ff]+((c.as_uint32&0x007fffff)>>
shifttable[(c.as_uint32>>23)&0x1ff]);
69 static inline float floatFromShort(
const short_float h) {
82 #define SHORT_FLOAT_MACHINE_EPS 0.0009765625