Function

vvfmod

Calculates the modulus after dividing each element in an array by the corresponding element in a second array of double-precision values.

Declaration

void vvfmod(double *, const double *, const double *, const int *);

Parameters

parameter 1

The output array, z.

parameter 2

The numerators input array, y.

parameter 3

The denominators input array, x.

parameter 4

The number of elements in the arrays.

Discussion

This function calculates z=y-k*x, for an integer k such that if x is nonzero, the result has the same sign as y and magnitude less than that of x.

The following code shows an example of using vvfmod:

double x[] = {7, 4, 3, 4};
double y[] = {2, 5, 10, 30};
double z[4];
int n = 4;
 
vvfmod(z, y, x, &n);
 
NSLog(@"z: [%lf, %lf, %lf, %lf]", z[0], z[1], z[2], z[3]);

See Also

Array-Oriented Arithmetic and Auxiliary Functions

vvceil

Calculates the ceiling of each element in an array of double-precision values.

vvceilf

Calculates the ceiling of each element in an array of single-precision values.

vvfloor

Calculates the floor of each element in an array of double-precision values.

vvfloorf

Calculates the floor of each element in an array of single-precision values.

vvcopysign

Copies an array, setting the sign of each element based on a second array of double-precision values.

vvcopysignf

Copies an array, setting the sign of each element based on a second array of single-precision values.

vvdiv

Divides each element in an array by the corresponding value in a second array of double-precision values.

vvdivf

Divides each element in an array by the corresponding value in a second array of single-precision values.

vvfabs

Calculates the absolute value for each element in an array of double-precision values.

vvfabsf

Calculates the absolute value for each element in an array of single-precision values.

vvfmodf

Calculates the modulus after dividing each element in an array by the corresponding element in a second array of single-precision values.

vvremainder

Calculates the remainder after dividing each element in an array by the corresponding element in a second array of double-precision values.

vvremainderf

Calculates the remainder after dividing each element in an array by the corresponding element in a second array of single-precision values.

vvint

Calculates the integer truncation for each element in an array of double-precision values.

vvintf

Calculates the integer truncation for each element in an array of single-precision values.

vvnint

Calculates the nearest integer for each element in an array of double-precision values.

vvnintf

Calculates the nearest integer for each element in an array of single-precision values.

vvrsqrt

Calculates the reciprocal square root of each element in an array of double-precision values.

vvrsqrtf

Calculates the reciprocal square root of each element in an array of single-precision values.

vvsqrt

Calculates the square root of each element in an array of double-precision values.

vvsqrtf

Calculates the square root of each element in an array of single-precision values.

vvrec

Calculates the reciprocal of each element in an array of double-precision values.

vvrecf

Calculates the reciprocal of each element in an array of single-precision values.

vvnextafter

Calculates the next machine-representable value for each element in an array of double-precision values.

vvnextafterf

Calculates the next machine-representable value for each element in an array of single-precision values.