Developer Reference for Intel® oneAPI Math Kernel Library for C
v?Fmod
The v?Fmod function performs element by element computation of the modulus function of vector a with respect to vector b.
Syntax
vhFmod (n, a, b, y);
vhFmodI(n, a, inca, b, incb, y, incy);
vmhFmod (n, a, b, y, mode);
vmhFmodI(n, a, inca, b, incb, y, incy, mode);
vsFmod (n, a, b, y);
vsFmodI(n, a, inca, b, incb, y, incy);
vmsFmod (n, a, b, y, mode);
vmsFmodI(n, a, inca, b, incb, y, incy, mode);
vdFmod (n, a, b, y);
vdFmodI(n, a, inca, b, incb, y, incy);
vmdFmod (n, a, b, y, mode);
vmdFmodI(n, a, inca, b, incb, y, incy, mode);
Include Files
- mkl.h
 
Input Parameters
Name  |  
      Type  |  
      Description  |  
     
|---|---|---|
n  |  
      const MKL_INT  |  
      Specifies the number of elements to be calculated.  |  
     
a, b  |  
      const _Float16* for vhFmod const float* for vsFmod const _Float16* for vmhFmod const float* for vmsFmod const double* for vdFmod const double* for vmdFmod  |  
      Pointers to arrays containing the input vectors a and b.  |  
     
inca, incb, incy  |  
      const MKL_INT  |  
      Specifies increments for the elements of a, b, and y.  |  
     
mode  |  
      const MKL_INT64  |  
      Overrides the global VM mode setting for this function call. See vmlSetMode for possible values and their description.  |  
     
Output Parameters
Name  |  
      Type  |  
      Description  |  
     
|---|---|---|
y  |  
      _Float16* for vhFmod float* for vsFmod _Float16* for vmhFmod float* for vmsFmod double* for vdFmod double* for vmdFmod  |  
      Pointer to an array containing the output vector y.  |  
     
Description
The v?Fmod function computes the modulus function of each element of vector a, with respect to the corresponding elements of vector b:
ai - bi*trunc(ai/bi)
In general, the modulus function fmod (ai, bi) returns the value ai - n*bi for some integer n such that if bi is nonzero, the result has the same sign as ai and a magnitude less than the magnitude of bi.
| Argument 1 | Argument 2 | Result | VM Error Status | Exception | 
|---|---|---|---|---|
| x not NAN | ±0 | NAN | VML_STATUS_SING | INVALID | 
| ±∞ | y not NAN | NAN | VML_STATUS_SING | INVALID | 
| ±0 | y≠ 0, not NAN | ±0 | ||
| x finite | ±∞ | x | UNDERFLOW if x is subnormal | |
| NAN | y | NAN | ||
| x | NAN | NAN | 
If element i in the result of v?Fmod is 0, its sign is that of ai.