About 1,180,000 results
Open links in new tab
  1. Understanding The Modulus Operator % - Stack Overflow

    Jul 8, 2013 · % is called the modulo operation. For instance, 9 divided by 4 equals 2 but it remains 1. Here, 9 / 4 = 2 and 9 % 4 = 1. In your example: 5 divided by 7 gives 0 but it remains 5 (5 % …

  2. How to calculate a Modulo? - Mathematics Stack Exchange

    Feb 28, 2018 · The result of 10 modulo 5 is 0 because the remainder of 10 / 5 is 0. The result of 7 modulo 5 is 2 because the remainder of 7 / 5 is 2. The reason your calculator says 113 modulo …

  3. How does a modulo operation work when the first number is …

    Oct 8, 2009 · Modulo inherently produces an integer result, whereas division can be an integer or floating point operation. Your observation that 2/5 equals 0.4 indicates you're thinking in terms …

  4. How does the % operator (modulo, remainder) work?

    Oct 2, 2024 · You can think of the modulus operator as giving you a remainder. count % 6 divides 6 out of count as many times as it can and gives you a remainder from 0 to 5 (These are all …

  5. c - Modulo operation with negative numbers - Stack Overflow

    Jul 30, 2012 · The % operator in C is not the modulo operator but the remainder operator. Modulo and remainder operators differ with respect to negative values. With a remainder operator, the …

  6. modulo - Understanding Mod Operator in Math vs Programming

    Apr 14, 2019 · In programming however, there are operators in many languages which can be used to mean either the remainder operator or modulo operator which differ with respect to …

  7. modulo - How to use mod operator in bash? - Stack Overflow

    If someone needs this for mathematical operations, note that modulo operation with negative numbers in bash returns only remainder, not mathematical modulo result. This means, that …

  8. math - Modulo in order of operation - Stack Overflow

    Jun 24, 2010 · The modulo operator %, as used in many computer programming languages, is not common in pure mathematics. So it is rather a question of how the operator is treated in …

  9. Better ways to implement a modulo operation (algorithm question)

    May 5, 2010 · Doing the modulo at each step will also reduce the overall size of your multiplier (same length as input rather than double). The shifting of the modulus you're doing is getting …

  10. Is it better to avoid using the mod operator when possible?

    Mar 24, 2013 · Compiling with either gcc or clang with -O3, and running time ./a.out 0 42 1000000000 (modulo version) or time ./a.out 1 42 1000000000 (comparison version) results …