dsub

Subtract double

Bytecode

Type Description
u1 dsub opcode = 0x67 (103)

Stack ..., value1.word1, value1.word2, value2.word1, value2.word2 => ..., result.word1, result.word2

Description
Takes the top two double-precision floating point numbers from the stack, subtracts the top one from the second (i.e. computes value2 - value1), and pushes the double-precision result back onto the stack.

Both value1 and value2 must be of type double. The values are popped from the operand stack. The double result is value1 - value2. The result is pushed onto the operand stack.

For double subtraction, it is always the case that a-b produces the same result as a+(-b). However, for the dsub instruction, subtraction from zero is not the same as negation, because if x is +0.0, then 0.0-x equals +0.0, but -x equals -0.0.

The Java Virtual Machine requires support of gradual underflow as defined by IEEE 754. Despite the fact that overflow, underflow, or loss of precision may occur, execution of a dsub instruction never throws a runtime exception.