frem 0x72
Takes the remainder of two floats on top of the stack; pushes the result.
- Opcode
0x72(114)- Family
- Arithmetic and bitwise
- Operands
- none
- Length
- 1 byte
- Operand stack
…, value1 (float), value2 (float) → …, result (float)- Can throw
- nothing at run time (beyond linking errors)
What it does
a % b on two floats: pops b, then a, and pushes the result.
The remainder truncates toward zero, like C's fmod, not IEEE 754's remainder (which Math.IEEEremainder computes). javac emits it for % on floats, which is rare in practice: java.base contains none.
How often javac uses it
It does not appear anywhere in JDK 25.0.5's java.base module: none of its 7,391 classes uses it.
Example
From the sample classes, compiled by javac 25 with -g. Each Java line is shown above the bytecode it compiled to; frem is highlighted.
static float floats(float a, float b) in Tour, compiled by javac 25Related instructions
irem Takes the remainder of two ints on top of the stack; pushes the result.lrem Takes the remainder of two longs on top of the stack; pushes the result.drem Takes the remainder of two doubles on top of the stack; pushes the result.
Specification: JVMS §6.5, frem (Java SE 25).