diff options
Diffstat (limited to 'include/libcss/fpmath.h')
-rw-r--r-- | include/libcss/fpmath.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/libcss/fpmath.h b/include/libcss/fpmath.h index eec40b3..a080fc1 100644 --- a/include/libcss/fpmath.h +++ b/include/libcss/fpmath.h @@ -155,6 +155,9 @@ css_float_to_fixed(const float a) { #define F_300 0x0004b000 /* 300 */ #define F_400 0x00064000 /* 400 */ +/* Fixed point percentage `p` of integer `i`, to an integer */ +#define FPCT_OF_INT_TOINT(p, i) (FIXTOINT(FDIV((p * i), F_100))) + #ifdef __cplusplus } #endif |