Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Vazquez <blendergit@gmail.com>2020-05-13 14:03:55 +0300
committerAntonio Vazquez <blendergit@gmail.com>2020-05-13 14:03:55 +0300
commit498bd0772ec54601241911b6a98f4fedf97d9166 (patch)
tree0a85b6e6a78603245d61958a5add2482a9bcb4cc /source/blender/blenlib/intern/math_base_inline.c
parentb55c78a289c600696282f97191d6e800a1c1ac34 (diff)
parentcbcc15bdaf98cf76ec42fb09e898c95407905f32 (diff)
Merge branch 'blender-v2.83-release'
Diffstat (limited to 'source/blender/blenlib/intern/math_base_inline.c')
-rw-r--r--source/blender/blenlib/intern/math_base_inline.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/math_base_inline.c b/source/blender/blenlib/intern/math_base_inline.c
index d5105a7cefc..2ad9b53ba3d 100644
--- a/source/blender/blenlib/intern/math_base_inline.c
+++ b/source/blender/blenlib/intern/math_base_inline.c
@@ -360,6 +360,14 @@ MINLINE int divide_floor_i(int a, int b)
}
/**
+ * Integer division that ceils the result, instead of flooring like normal C division.
+ */
+MINLINE uint divide_ceil_u(uint a, uint b)
+{
+ return (a + b - 1) / b;
+}
+
+/**
* modulo that handles negative numbers, works the same as Python's.
*/
MINLINE int mod_i(int i, int n)