About 1,950,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 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 …

  3. 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 …

  4. 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 …

  5. 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 …

  6. Bitwise and in place of modulus operator - Stack Overflow

    Jun 19, 2010 · Generally speaking, only modulo powers of base b can "easily" be done with base b representation of numbers. In base 10, for example, for non-negative N, N mod 10^k is just …

  7. 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 …

  8. What is the difference between Modulus, Absolute value and …

    The modulo function (a mod b) translated directly into programming etc. I found the naming a bit confusing too, but their usage is distinct enough that they shouldn't get confused. In …

  9. 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 …

  10. Python modulo on floats - Stack Overflow

    Feb 8, 2013 · Modulo gives you the rest of a division. 3.5 divided by 0.1 should give you 35 with a rest of 0. But since floats are based on powers of two the numbers are not exact and you get …

Refresh