矢量计算输入值的反余弦值除以π。
C interface:
void vsacospi(const int len, const float* src, float* dst);
void vdacospi(const int len, const double* src, double* dst);
参数名 |
类型 |
描述 |
输入/输出 |
---|---|---|---|
len |
整型数 |
表示输入向量的元素个数。 len≤0时会提示len无效并返回。 |
输入 |
src |
|
输入向量src,向量长度为len。 若为空指针,会提示空指针错误并返回。 |
输入 |
dst |
|
输出dst,向量长度为len。 若为空指针,会提示空指针错误并返回。 |
输出 |
输入值(src) |
输出值(dst) |
---|---|
1 |
0 |
-1 |
1.0 |
|x| > 1 |
nan |
±inf |
nan |
nan |
nan |
C: "kvml.h"
C interface:
int i, len = 4; float src[4] = {0.0f, 2.0f, INFINITY, NAN}; float* dst = (float*)malloc(sizeof(float) * len); if (dst == NULL) { printf("Malloc Failed!\n"); return 0; } vsacospi(len, src, dst); printf("\n"); /** * Output dst: * 0.500000 nan nan -nan */