About 5,620,000 results
Open links in new tab
  1. modulo - What's the syntax for mod in Java? - Stack Overflow

    The modulo operation returning only non-negative results, Rob referred to this as "mod", is called Euclidean modulo in this answer. The answer calls the behavior of Java's remainder operator …

  2. Using the modulo operator in java - Stack Overflow

    Aug 5, 2019 · Using the modulo operator in java Asked 6 years, 4 months ago Modified 6 years, 4 months ago Viewed 10k times

  3. ¿Cómo utilizar MOD en Java? - Stack Overflow en español

    Sep 25, 2017 · Me podrían ayudar a realizar un programa en JAVA. En el cual ingreso cualquier numero y de como resultado que números se pueden dividir entre 5,3,2 sin dejar residuos. por …

  4. java - ¿Cómo funciona el operador %? - Stack Overflow en español

    Alguno me puede explicar cómo funciona el operador %: ¿Qué es?¿Cuál es la lógica detrás de ese operador?¿Qué es lo que hace y qué es lo que devuelve? Por ejemplo, el siguiente …

  5. How does java do modulus calculations with negative numbers?

    Am I doing modulus wrong? Because in Java -13 % 64 evaluates to -13 but I want to get 51.

  6. java - How do I use modulus for float/double? - Stack Overflow

    Jun 1, 2010 · I'm creating an RPN calculator for a school project and having trouble with the modulus operator. Since we're using the double data type, modulus won't work on floating …

  7. math - Mod in Java produces negative numbers - Stack Overflow

    Mar 22, 2011 · When I calculate int i = -1 % 2 I get -1 in Java. In Python, I get 1 as the result of -1 % 2. What do I have to do to get the same behavior in Java with the modulo function?

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

  9. modulo - Best way to make Java's modulus behave like it should …

    Jan 31, 2017 · In java when you do a % b If a is negative, it will return a negative result, instead of wrapping around to b like it should. What's the best way to fix this? Only way I can think is a …

  10. Modulus with doubles in Java - Stack Overflow

    Jul 12, 2010 · 15 How do you deal with Java's weird behaviour with the modulus operator when using doubles? For example, you would expect the result of 3.9 - (3.9 % 0.1) to be 3.9 (and …