1 Matching Annotations
  1. Sep 2016
    1. One key difference here is that, in Haskell (not in all lan-guages), if one or both arguments are negative, the results ofmodwill have the same sign as the divisor, while the result ofremwill have the same sign as the dividend

      In other languages:

      • Python and Ruby: % is the modulus operator, same as mod in Haskell
      • JavaScript, Rust, Go: % is a remainder operator, so same as rem

    Tags

    Annotators