Add IEEE 754 pack and unpack helpers
[fio.git] / ieee754.h
... / ...
CommitLineData
1#ifndef FIO_IEEE754_H
2#define FIO_IEEE754_H
3
4extern uint64_t pack754(long double f, unsigned bits, unsigned expbits);
5extern long double unpack754(uint64_t i, unsigned bits, unsigned expbits);
6
7#define fio_double_to_uint64(val) pack754((val), 64, 11)
8#define fio_uint64_to_double(val) unpack754((val), 64, 11)
9
10#endif