Contents | Prev | Next | Index
frem
- If the dividend is finite and the divisor is an infinity, the result equals the dividend.
- If the dividend is a zero and the divisor is finite, the result equals the dividend.
- In the remaining cases, where neither an infinity, nor a zero, nor NaN is involved, the floating-point remainder result from a dividend value1 and a divisor value2 is defined by the mathematical relation , where q is an integer that is negative only if is negative and positive only if is positive, and whose magnitude is as large as possible without exceeding the magnitude of the true mathematical quotient of value1 and value2.
Despite the fact that division by zero may occur, evaluation of an frem instruction never throws a runtime exception. Overflow, underflow, or loss of precision cannot occur.
Notes
The IEEE 754 remainder operation may be computed by the Java library routine Math.IEEEremainder
.
Contents | Prev | Next | Index
Java Virtual Machine Specification (HTML generated by dkramer on February 25, 1997)
Copyright © 1996 Sun Microsystems, Inc.
All rights reserved
Please send any comments or corrections to doug.kramer@sun.com