OCaml mod function returns different result compared with %
Python is a bit different in its usage of the % operator, which really computes the modulo of two values, whereas other programming languages compute the remainder with the same operator. For example, the distinction is clear in Scheme: In Python: But in OCaml, there’s only mod (which computes the integer remainder), according to this table and as stated in the documentation: Of course, you can implement … Read more