About 21,700 results
Open links in new tab
  1. Understanding The Modulus Operator - Stack Overflow

    Jul 8, 2013 · 0 Modulus operator gives you the result in 'reduced residue system'. For example for mod 5 there are 5 integers counted: 0,1,2,3,4. In fact 19=12=5=-2=-9 (mod 7). The main …

  2. Modulo operator in Python - Stack Overflow

    What does modulo in the following piece of code do? from math import * 3.14 % 2 * pi How do we calculate modulo on a floating point number?

  3. What is the result of % (modulo operator / percent sign) in Python?

    This is because in JavaScript % is the "remainder" operator while in Python it is the "modulus" (clock math) operator. You can get the explanation directly from GvR: Edit - dahiya_boy In …

  4. The modulus operator (%) in python - Stack Overflow

    May 9, 2019 · I am new to programming, and I chose to learn Python, and I came across this operator (%) called modulus, but I don't understand it, can some explain it to me in more detail!

  5. math - `/` vs `//` for division in Python - Stack Overflow

    In Python 3.x, 5 / 2 will return 2.5 and 5 // 2 will return 2. The former is floating point division, and the latter is floor division, sometimes also called integer division. In Python 2.2 or later in the …

  6. Python: % operator in print() statement - Stack Overflow

    Dec 8, 2013 · The % operator in python for strings is used for something called string substitution. String and Unicode objects have one unique built-in operation: the % operator (modulo).

  7. python - Difference between modulus (%) and floor division (//) in ...

    Jun 17, 2019 · 3 Recently, I read a book on Numpy which mentions different types of ufuncs, where I was encountered with two different ufuncs, namely 'modulus', denoted by % symbol …

  8. How does the modulo (%) operator work on negative numbers in …

    Oct 7, 2010 · Exactly how does the % operator work in Python, particularly when negative numbers are involved? For example, why does -5 % 4 evaluate to 3, rather than, say, -1?

  9. python - Find the division remainder of a number - Stack Overflow

    That's because Python's % performs a true modulus, which returns values on the range [0, divisor) and pairs well with floored division (towards negative infinity). C languages use the % …

  10. python - What does the modulus symbol do here? - Stack Overflow

    Dec 13, 2013 · What does the modulus symbol do here? [duplicate] Asked 11 years, 11 months ago Modified 11 years, 7 months ago Viewed 361 times