Integer division that rounds up

From wikiluntti

Introduction

Usual integer division rounds down: for . To round up (if overflow is not an issue), you can use following algorithm with the usual roundig down division:

Proof

Proof is in two parts; 1st if divides , and if not.

Part 1. If divides we have for some .