drem : remainder of two doubles : index : visitInsn()

Description
Pops two double-precision numbers off the operand stack, divides by the top double, computes the remainder and pushes the double-precision result back onto the stack. This is like the C function fmod. The remainder is computed using the equation:

remainder = value2 - (intof( value2 / value1 ) * value1)

where intof () rounds towards the nearest integer, or towards the nearest even integer if the number is half way between two integers.
Notes
1. Divide by zero will result in NaN being pushed onto the stack as the result.

2. This operation is not the same as the IEEE-defined remainder operation, which uses slightly different rules for rounding. Use the Java library routine Math.IEEEremainder if you want the IEEE behavior.
See also
irem frem lrem
Stack
Before After
value1-word1 result-word1
value1-word2 result-word2
value2-word1 ...
value2-word2 ...
... ...
Bytecode
Type Description
u1 drem opcode = 0x73 (115)