| 34 | } |
| 35 | |
| 36 | static void test_new() { |
| 37 | hc_fix_t x = hc_fix(2, -125); |
| 38 | assert(hc_fix_exp(x) == 2); |
| 39 | assert(hc_fix_val(x) == -125); |
| 40 | assert(hc_fix_int(x) == -1); |
| 41 | assert(hc_fix_frac(x) == -25); |
| 42 | assert(hc_fix_double(x) == -1.25); |
| 43 | } |
| 44 | |
| 45 | static void test_sub() { |
| 46 | assert(hc_fix_sub(hc_fix(2, 175), hc_fix(2, 25)) == |
no test coverage detected