76.

prev next contents
frem

remainder of two floats

Jasmin Syntax
     frem 
Stack

Before

After
value1
result
value2
...
...

Description

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

Description
u1
frem opcode = 0x72 (114)
See Also

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.


prev next contents
Java Virtual Machine, by Jon Meyer and Troy Downing, O'Reilly Associates


Java Virtual Machine
Java Virtual Machine (Java Series)
ISBN: 1565921941
EAN: 2147483647
Year: 1996
Pages: 171

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net