| 6 | #include "stream1/stream1.h" |
| 7 | |
| 8 | uint32_t hc_scale(const uint8_t exp) { |
| 9 | static const uint32_t scale[HC_FIX_MAX_EXP+1] = { |
| 10 | 1, |
| 11 | 10, |
| 12 | 100, |
| 13 | 1000, |
| 14 | 10000, |
| 15 | 100000, |
| 16 | 1000000, |
| 17 | 10000000}; |
| 18 | |
| 19 | assert(exp <= HC_FIX_MAX_EXP); |
| 20 | return scale[exp]; |
| 21 | } |
| 22 | |
| 23 | hc_fix_t hc_fix(const uint8_t exp, const int64_t val) { |
| 24 | return (hc_fix_t)hc_bitmask(exp, HC_FIX_EXP) + |
no outgoing calls
no test coverage detected