About 87 results
Open links in new tab
  1. How to calculate a mod b in Python? - Stack Overflow

    Jun 13, 2009 · Is there a modulo function in the Python math library? Isn't 15 % 4, 3? But 15 mod 4 is 1, right?

  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?

    For Python, I made the same choice because there are some interesting applications of the modulo operation where the sign of a is uninteresting. Consider taking a POSIX timestamp (seconds since …

  4. python - If statement with modulo operator - Stack Overflow

    Nov 8, 2016 · Open up the Python console, and do 4 % 2, what is the result? Then do 3 % 2, what is the result? Now which of the results would be considered "true"? The modulo operator returns the …

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

  6. 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!

  7. Understanding The Modulus Operator - Stack Overflow

    Jul 8, 2013 · In mathematics, the result of a modulo operation is the remainder of an arithmetic division. So, in your specific case, when you try to divide 7 bananas into a group of 5 bananas, you're able to …

  8. Python modulo on floats - Stack Overflow

    Feb 8, 2013 · Can anyone explain how the modulo operator works in Python? I cannot understand why 3.5 % 0.1 = 0.1.

  9. python - Como funciona o operador módulo (%)? - Stack Overflow em …

    Aug 19, 2020 · A documentação ainda menciona que " The modulo operator always yields a result with the same sign as its second operand (or zero) " (o operador % sempre retorna um valor cujo sinal é …

  10. python - Modulo Operation for Odd & Even Number - Stack Overflow

    Jan 5, 2022 · Modulo Operation for Odd & Even Number Asked 4 years ago Modified 4 months ago Viewed 8k times