gba-trycatch
view src/fixed.h @ 15:b755fb002f17
foo
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Wed, 25 Jun 2014 17:02:48 +0300 |
parents | 158d23956801 |
children |
line source
1 #ifndef FIXED_H_
2 #define FIXED_H_
4 #include <stdint.h>
6 #define ftox16(x) (int32_t)((x) * 65536.0f)
7 #define itox16(x) (int32_t)((x) << 16)
9 #define x16tof(x) (float)((x) / 65536.0f)
10 #define x16toi(x) ((x) >> 16)
12 #define x16mul(a, b) (int32_t)(((int32_t)(a) >> 8) * ((int32_t)(b) >> 8))
13 /*int32_t x16div(register int32_t num, register int32_t denom);*/
14 #define x16div(a, b) (int32_t)(((int64_t)(a) << 16) / (b))
16 #define x16sq(x) x16mul(x, x)
18 #endif /* FIXED_H_ */