1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

[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