Rate This Document
Findability
Accuracy
Completeness
Readability

v?atan2pi

Interface Definition

C interface:

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

void vdatan2pi(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 vsatan2pi
  • Double-precision floating-point type for vdatan2pi

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 vsatan2pi
  • Double-precision floating-point type for vdatan2pi

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 vsatan2pi
  • Double-precision floating-point type for vdatan2pi

Output vector dst with length len.

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

Output

Return Value

  • The value of each operation value's arctangent divided by π is returned. The value range is (–1, +1].
  • For special values, see the following table.

    Input Value 1 (src1)

    Input Value 2 (src2)

    Output Value (dst)

    ±0

    -0

    ±1

    ±0

    +0

    ±0

    ±∞

    finite

    ±1/2

    ±∞

    -∞

    ±3/4

    ±∞

    +∞

    ±1/4

    <0

    ±0

    -1/2

    >0

    ±0

    -1/2

    +finite

    -inf

    +1

    -finite

    -inf

    -1

    +finite

    +inf

    +0

    -finite

    +inf

    -0

    nan

    any

    nan

    any

    nan

    nan

Dependency

C: "kvml.h"

Example

C interface:

    int i, len = 4; 
    float src1[len] = {0.0f, 1.0f, -inf, inf}; 
    float src2[len] = {0.0f, 2.0f, inf, nan}; 
    float* dst = (float*)malloc(sizeof(float) * len); 
    if (dst == NULL) { 
        printf("Malloc Failed!\n"); 
        return 0; 
    } 
    vsatan2pi(len, src1, src2, dst); 
    /** 
     *  Output dst: 
     *     0.0  0.14758362  -0.25  nan 
     * 
     */