ldivStack
Before | After |
value1-word1 | result-word1 |
value1-word2 | result-word2 |
value2-word1 | ... |
value2-word2 | |
... |
Pops the top two two-word long integers from the stack and divides by the top long integer (i.e. computes value2 / value1). The result is rounded to the nearest integer, with rounding going towards 0. The long integer quotient result is pushed back onto the stack.
Exceptions
ArithmeticException - the divisor (value2) is zero.
Bytecode Type
See Also Description u1 ldiv opcode = 0x6D (109)
idiv, fdiv, ddiv
Notes
Because of the two's-complement representation used for negative numbers, dividing Long.MIN_VALUE by -1 produces Long.MIN_VALUE, not Long.MAX_VALUE as you might expect.