summaryrefslogtreecommitdiff
path: root/include/libcss
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2022-12-16 13:40:45 +0000
committerMichael Drake <mdrake.unique@gmail.com>2022-12-16 13:45:04 +0000
commit58f1673186a41b396d4ca4e13f43b502a305bf01 (patch)
tree519494d67ae0699d237dd862c1862f894078624f /include/libcss
parentf5842253bdb62fef9543e58ae38c232f5b4f982a (diff)
downloadlibcss-58f1673186a41b396d4ca4e13f43b502a305bf01.tar.gz
libcss-58f1673186a41b396d4ca4e13f43b502a305bf01.tar.bz2
api: fpmath: Add macro to get fractional part
Diffstat (limited to 'include/libcss')
-rw-r--r--include/libcss/fpmath.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/libcss/fpmath.h b/include/libcss/fpmath.h
index d7cac4d..eec40b3 100644
--- a/include/libcss/fpmath.h
+++ b/include/libcss/fpmath.h
@@ -130,6 +130,8 @@ css_float_to_fixed(const float a) {
/* truncate a fixed point value */
#define TRUNCATEFIX(a) (a & ~((1 << CSS_RADIX_POINT)- 1 ))
+/* get fractional component of a fixed point value */
+#define FIXFRAC(a) (a & ((1 << CSS_RADIX_POINT)- 1 ))
/* Useful values */
#define F_PI_2 0x00000648 /* 1.5708 (PI/2) */