fadd

Add two floats

Bytecode

Type Description
u1 fadd opcode = 0x62 (98)

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

Description

Pops two single-precision floating point numbers off the operand stack, adds them, and pushes the result back onto the stack. Floating point addition follows IEEE rules.

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

The result of an fadd instruction is governed by the rules of IEEE arithmetic:

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 an fadd instruction never throws a runtime exception.