About 79,400 results
Open links in new tab
  1. math - Integer division in Java - Stack Overflow

    Jun 13, 2016 · Int division in a computer basically is very similar to how you would do long division with paper and pencil to get a quotient and a remainder. The main difference is, the computer does it in …

  2. math - Division of integers in Java - Stack Overflow

    Division of integers in Java [duplicate] Asked 14 years, 3 months ago Modified 7 years, 1 month ago Viewed 290k times

  3. java - Int division: Why is the result of 1/3 == 0? - Stack Overflow

    double g = 1.0/3.0 This happens because Java uses the integer division operation for 1 and 3 since you entered them as integer constants.

  4. java - How do I divide so I get a decimal value? - Stack Overflow

    Mar 20, 2009 · 28 I want to know how to get remainder and quotient in single value in Java. Example: 3/2 I should get value as 1.5. If I use the / operator I get only the quotient. If I user the % operator I …

  5. Difference between % (modulus) and / (divided) in Java?

    The percent symbol is the modulus operator. I would say that they wanted you to recognize the difference that the division operator on integer inputs gives an integer result. The modulus operator …

  6. What is the remainder of integer division? - Stack Overflow

    2 int remainder = a % b; will sort you. The remainder operator returns the remainder of the division. Note that the remainder operator is also called the modulo operator. However, this is incorrect for Java as …

  7. Java - How to do floor division? - Stack Overflow

    Dec 19, 2018 · I know that in Python you can do floor division like this: 5 // 2 #2 The // is used for something totally different in Java. Is there any way to do floor division in Java?

  8. java - What is the difference between Truncated Division and Floored ...

    May 30, 2017 · The Java division operator is defined by JLS §15.17.2. Division Operator /: Integer division rounds toward 0. That is why 5 / -3 result in -1. You can also look at the definition of …

  9. algorithm - Division without using '/' - Stack Overflow

    0 Well, if this is only integer/integer = int type division, it's pretty easy to get the integer part of x / n = int.dec by adding n+n+n+n until n is greater than x, then subtracting one from your 'n' count. To get …

  10. Integer division: How do you produce a double? - Stack Overflow

    Integer division: How do you produce a double? Asked 15 years, 5 months ago Modified 5 years, 4 months ago Viewed 556k times