MCPcopy Create free account
hub / github.com/codr7/hacktical-c / hc_scale

Function hc_scale

fix/fix.c:8–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6#include "stream1/stream1.h"
7
8uint32_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
23hc_fix_t hc_fix(const uint8_t exp, const int64_t val) {
24 return (hc_fix_t)hc_bitmask(exp, HC_FIX_EXP) +

Callers 7

hc_fix_intFunction · 0.85
hc_fix_fracFunction · 0.85
hc_fix_doubleFunction · 0.85
hc_fix_addFunction · 0.85
hc_fix_subFunction · 0.85
hc_fix_mulFunction · 0.85
hc_fix_divFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected