diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2020-05-13 14:03:55 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2020-05-13 14:03:55 +0300 |
commit | 498bd0772ec54601241911b6a98f4fedf97d9166 (patch) | |
tree | 0a85b6e6a78603245d61958a5add2482a9bcb4cc /source/blender/blenlib/intern/math_base_inline.c | |
parent | b55c78a289c600696282f97191d6e800a1c1ac34 (diff) | |
parent | cbcc15bdaf98cf76ec42fb09e898c95407905f32 (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.c | 8 |
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) |