5static bool PtexHalfInit(uint32_t* h2fTable, uint16_t* f2hTable)
7 union {
int i;
float f; } u;
9 for (
int h = 0; h < 65536; h++) {
10 int s = (h & 0x8000)<<16;
14 if (
unsigned(e-1) < ((31<<10)-1)) {
16 u.i = s|(((e+0x1c000)|m)<<13);
20 if (!(h&0x8000)) u.f = float(5.9604644775390625e-08*m);
21 else u.f = float(-5.9604644775390625e-08*m);
25 u.i = s|0x7f800000|(m<<13);
30 for (
int i = 0; i < 512; i++) {
32 int e = (f & 0x7f800000) - 0x38000000;
34 if (
unsigned(e-1) < ((31<<23)-1)) {
35 int s = ((f>>16) & 0x8000);
38 f2hTable[i] = (uint16_t)((s|((e|m)>>13))+((f>>12)&1));