我要评分
获取效率
正确性
完整性
易理解

v?remainder

Compute the remainder of input vector 1/input vector 2.

Interface Definition

C interface:

void vsremainder(const int len, const float* src1, const float* src2, float* dst);

void vdremainder(const int len, const double* src1, const double* src2, double* dst);

Parameters

Parameter

Type

Description

Input/Output

len

Integer

Number of elements in the input vector.

If len ≤ 0, the system displays a message indicating that the value of len is invalid.

Input

src1

  • Single-precision floating-point type for vsremainder
  • Double-precision floating-point type for vdremainder

Input vector src1 with length len.

If the pointer is null, the system prompts a null pointer error.

Input

src2

  • Single-precision floating-point type for vsremainder
  • Double-precision floating-point type for vdremainder

Input vector src2 with length len.

If the pointer is null, the system prompts a null pointer error.

Input

dst

  • Single-precision floating-point type for vsremainder
  • Double-precision floating-point type for vdremainder

Output vector dst with length len.

If the pointer is null, the system prompts a null pointer error.

Output

Return Value

The remainder of input vector 1 divided by input vector 2 is returned.

Input Value 1 (src1)

Input Value 2 (src2)

Output Value (dst)

any

±nan

nan

any

±0

nan

±inf

any

nan

±nan

any

nan

Dependency

C: "kvml.h"

Examples

C interface:
    #define N 4
    const float src1[N] = {-8.0f, 25.0f, +INFINITY, -0.0f};
    const float src2[N] = {6.2f, -4.3f, -192.4, -3.1f};
    float dst[N] = {0};

    vsremainder(N, src1, src2, dst);
    printFArr("input1:", N, src1);
    printFArr("input2:", N, src2);
    printFArr("output:", N, dst);
 
    /** 
     *  input1: -8.000   25.000      inf   -0.000 
     *  input2:  6.200   -4.300 -192.400   -3.100
     *  output: -1.800   -0.800      nan   -0.000
     */