3.5.1.1.35 Rmod

Description

This function returns the real modulus (the remainder from division) of real number x divided by real number y, which is denoted by formula

x-N*y

where N is the integer of \frac{x}{y} round toward 0.

Syntax

double rmod( double x,double y)

Parameter

x:

is the dividend. Can be any real number.

y

is the divisor. Can be any real number.

Return

Returns the real modulus of real number x divided by real number y.

Examples

val1 = rmod(4.5, 2);    // val1 is 0.5
val2 = rmod(4.2,1.3);   // val2 is 0.3

See Also

rmod2, mod, mod2,