fremStack
Before | After |
value1 | result |
value2 | ... |
... |
Pops two single-precision numbers off the operand stack, divides by the top float, computes the remainder and pushes the single-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.
Bytecode Type
See Also Description u1 frem opcode = 0x72 (114)
irem, lrem, drem
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.