summaryrefslogtreecommitdiff
path: root/include/fitz/math.h
diff options
context:
space:
mode:
authorTor Andersson <tor@ghostscript.com>2004-11-04 14:46:53 +0100
committerTor Andersson <tor@ghostscript.com>2004-11-04 14:46:53 +0100
commitcbbee31601e34f1f513a4d046d52963baebf07fa (patch)
tree6393fbd6066e53dcb7ed2b52f262f6ef0514e927 /include/fitz/math.h
parent3386060e982e4fc353a4c405316c0c83bf459bab (diff)
downloadmupdf-cbbee31601e34f1f513a4d046d52963baebf07fa.tar.xz
type3 fonts
Diffstat (limited to 'include/fitz/math.h')
-rw-r--r--include/fitz/math.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/fitz/math.h b/include/fitz/math.h
index bcbfee00..bfc1f8e6 100644
--- a/include/fitz/math.h
+++ b/include/fitz/math.h
@@ -4,6 +4,21 @@ static inline unsigned char fz_mul255(unsigned char a, unsigned char b)
return ((a + 1) * b) >> 8;
}
+/* floor / ceil towards/from +/- inf */
+static inline float fz_floor(float x)
+{
+ if (x > 0)
+ return floor(x);
+ return ceil(x);
+}
+
+static inline float fz_ceil(float x)
+{
+ if (x > 0)
+ return ceil(x);
+ return floor(x);
+}
+
/* divide and floor towards -inf */
static inline int fz_idiv(int a, int b)
{