Negative integer division surprising result
For the actual values, i.e. 8.0/(-7.0), the result is roughly -1.143. Your result using integer division is being rounded down toward the more negative value of -2. (This is also known as “Floor division”) This is why you will get the somewhat perplexing answers of: >>> 8/(-7) -2 >>> 8/7 1 Note: This is “fixed” … Read more