[Python] OCaml mod function returns different result compared with %

Discussão em 'Python' iniciado por Stack, Dezembro 1, 2025.

  1. Stack

    Stack Membro Participativo

    The modulo function in OCaml mod return results different when compared with the modulo operator in python.

    OCaml:

    # -1 mod 4
    - : int = -1


    Python:

    >>> -1 % 4
    3


    Why are the result different?.

    Is there any standard module function that operate as % in OCaml?.

    Continue reading...

Compartilhe esta Página