# Integer division behaviour

**URL:** <https://discuss.ocaml.org/t/integer-division-behaviour/5815>\
**Category:** Learning\
**Created:** [May 20, 2020, 5:09pm UTC](https://discuss.ocaml.org/t/integer-division-behaviour/5815 "2020-05-20T17:09:13Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![dmbaturin](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/dmbaturin/32/2074_2.png) [@dmbaturin](https://discuss.ocaml.org/u/dmbaturin)\
**Post date:** [May 20, 2020, 5:09pm UTC](https://discuss.ocaml.org/t/integer-division-behaviour/5815/1 "2020-05-20T17:09:13Z")

</div>

Number theoretically correct integer division is supposed to work so that `(N / K) + (N mod K) = N`.  
I was very surprised to see that it’s not how `(/) : int → int` works!

```auto
# 3 mod 2 ;;
- : int = 1

```

Now, two questions. What is the justification for this behaviour? And does anything provid real integer division?

---

_[View the full topic](https://discuss.ocaml.org/t/integer-division-behaviour/5815)._
