frem - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.
Our website is currently undergoing maintenance, which may result in occasional errors while browsing. We apologize for any inconvenience this may cause and are working swiftly to restore full functionality. Thank you for your patience.

Online Help

All Products    Maple    MapleSim


frem

return the floating-point remainder

 

Calling Sequence

Parameters

Description

Thread Safety

Examples

Calling Sequence

frem(x, y)

Parameters

x

-

extended_numeric or complex

y

-

extended_numeric or complex

Description

• 

The frem(x, y) function returns r = x - y*n where n is the integer nearest the exact value x/y. The value of n is taken to be even in the case of a tie.

• 

The rounding mode is not considered for this computation. If r = 0, then its sign is set to that of x.

• 

If y is real, frem(x, y) maps onto complex numerics.

• 

This function signals invalid_operation if y is unordered with 0 (unless y is already a NaN).

  

Note:  If m and n are integers, frem(m, n) is not necessarily the same mathematical value as irem(m, n), since frem() computes by using the nearest integer to the quotient m/n, not the integer quotient of m by n.

Thread Safety

• 

The frem command is thread-safe as of Maple 15.

• 

For more information on thread safety, see index/threadsafe.

Examples

frem2.2,3

−0.8

(1)

frem2.2,3

0.8

(2)

frem2,3

−1.

(3)

irem2,3

2

(4)

See Also

complex

exceptions

float

irem

Rounding