---
title: v?remainder
description: "计算两个输入向量相除的余数。"
url: https://www.hikunpeng.com/document/detail/zh/kunpengboostkithistory/240RC2/accel/kunpengaccel_kml_16_0304.html
sourcePath: /source/zh/kunpengboostkithistory/240RC2/accel/kunpengaccel_kml_16_0304.html
indexId: 9155e3ca5b3992ff5e523898b49f6556cf62e3fe6b3d322ced948a9a5ce0470f76
---
# v?remainder

计算两个输入向量相除的余数。

#### 接口定义

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);


#### 参数

| 参数名 | 类型 | 描述 | 输入/输出 |
| --- | --- | --- | --- |
| len | 整型数 | 表示输入向量的元素个数。 len≤0时会提示len无效并返回。 | 输入 |
| src1 | 在vsremainder中是单精度浮点类型。 在vdremainder中是双精度浮点类型。 | 输入向量src1，向量长度为len。 若为空指针，会提示空指针错误并返回。 | 输入 |
| src2 | 在vsremainder中是单精度浮点类型。 在vdremainder中是双精度浮点类型。 | 输入向量src2，向量长度为len。 若为空指针，会提示空指针错误并返回。 | 输入 |
| dst | 在vsremainder中是单精度浮点类型。 在vdremainder中是双精度浮点类型。 | 输出dst，向量长度为len。 若为空指针，会提示空指针错误并返回。 | 输出 |


#### 输出结果

每一组输入值相除的余数。| 输入值（src1） | 输入值（src2） | 输出值（dst） |
| --- | --- | --- |
| any | ±nan | nan |
| any | ±0 | nan |
| ±inf | any | nan |
| ±nan | any | nan |


#### 依赖

C: "kvml.h"


#### 示例

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
*/
```
