remove math.blas.syntax and merge parsing words into math.blas.vectors/matrices
[factor/jcg.git] / vm / float_bits.h
bloba60d42f97c5da5954cdd3c90cef4fec0601fe755
1 /* Some functions for converting floating point numbers to binary
2 representations and vice versa */
4 typedef union {
5 double x;
6 u64 y;
7 } F_DOUBLE_BITS;
9 INLINE u64 double_bits(double x)
11 F_DOUBLE_BITS b;
12 b.x = x;
13 return b.y;
16 INLINE double bits_double(u64 y)
18 F_DOUBLE_BITS b;
19 b.y = y;
20 return b.x;
23 typedef union {
24 float x;
25 u32 y;
26 } F_FLOAT_BITS;
28 INLINE u32 float_bits(float x)
30 F_FLOAT_BITS b;
31 b.x = x;
32 return b.y;
35 INLINE float bits_float(u32 y)
37 F_FLOAT_BITS b;
38 b.y = y;
39 return b.x;