EN
注册
我要评分
文档获取效率
文档正确性
内容完整性
文档易理解
在线提单
论坛求助
鲲鹏小智

catan

计算复数x的反正切值。

接口定义

C interface:

float complex catanf(float complex x);

double complex catan(double complex x);

long double complex catanl(long double complex x);

参数

参数名

类型

描述

输入/输出

x

  • 在catanf中,x是复数单精度浮点类型。
  • 在catan中,x是复数双精度浮点类型。
  • 在catanl中,x是复数长双精度浮点类型。

表示输入数据的浮点值。

输入

返回值

  • 返回x的反正切结果y。
  • 特殊值说明如下所示。

    输入值实部(x.real)

    输入值虚部(x.imag)

    输出值实部(y.real)

    输出值虚部(y.imag)

    -inf

    -inf

    -pi/2

    -0.0

    -inf

    < +0.0

    -pi/2

    -0.0

    -inf

    -0.0

    -pi/2

    -0.0

    -inf

    +0.0

    -pi/2

    +0.0

    -inf

    > +0.0

    -pi/2

    +0.0

    -inf

    inf

    -pi/2

    +0.0

    -inf

    -nan

    -pi/2

    +0.0

    -inf

    nan

    -pi/2

    +0.0

    < +0.0

    -inf

    -pi/2

    -0.0

    < +0.0

    inf

    -pi/2

    +0.0

    < +0.0

    -nan

    nan

    nan

    < +0.0

    nan

    nan

    nan

    -0.0

    -inf

    -pi/2

    -0.0

    -0.0

    -0.0

    -0.0

    -0.0

    -0.0

    +0.0

    -0.0

    0.0

    -0.0

    inf

    -pi/2

    +0.0

    -0.0

    -nan

    nan

    nan

    -0.0

    nan

    nan

    nan

    +0.0

    -inf

    pi/2

    -0.0

    +0.0

    -0.0

    +0.0

    -0.0

    +0.0

    +0.0

    +0.0

    +0.0

    +0.0

    inf

    pi/2

    +0.0

    +0.0

    -nan

    nan

    nan

    +0.0

    nan

    nan

    nan

    > +0.0

    -inf

    pi/2

    -0.0

    > +0.0

    inf

    pi/2

    +0.0

    > +0.0

    -nan

    nan

    nan

    > +0.0

    nan

    nan

    nan

    inf

    -inf

    pi/2

    -0.0

    inf

    < +0.0

    pi/2

    -0.0

    inf

    -0.0

    pi/2

    -0.0

    inf

    +0.0

    pi/2

    +0.0

    inf

    > +0.0

    pi/2

    +0.0

    inf

    inf

    pi/2

    +0.0

    inf

    -nan

    pi/2

    +0.0

    inf

    nan

    pi/2

    +0.0

    -nan

    -inf

    nan

    -0.0

    -nan

    < +0.0

    nan

    nan

    -nan

    -0.0

    nan

    -0.0

    -nan

    +0.0

    nan

    +0.0

    -nan

    > +0.0

    nan

    nan

    -nan

    inf

    nan

    +0.0

    -nan

    -nan

    nan

    nan

    -nan

    nan

    nan

    nan

    nan

    -inf

    nan

    -0.0

    nan

    < +0.0

    nan

    nan

    nan

    -0.0

    nan

    -0.0

    nan

    +0.0

    nan

    +0.0

    nan

    > +0.0

    nan

    nan

    nan

    inf

    nan

    +0.0

    nan

    -nan

    nan

    nan

    nan

    nan

    nan

    nan

依赖

C: "km.h"

示例

C interface:
    // typical usage
    double x1 = 1.0, x2 = 2.0, x3 = 3.0, x4 = 4.0;
    double complex cx1 = __builtin_complex(x1, x2);
    double complex cx2 = __builtin_complex(x3, x4);
    double complex cx3 = __builtin_complex(NAN, NAN);
    double complex cx4 = __builtin_complex(INFINITY, -INFINITY);
    double ry;
    double iy;
    ry = __real__ catan(cx1);
    iy = __imag__ catan(cx1);
    printf("catan(cx1) = %.15f, %.15f\n", ry, iy);
    ry = __real__ catan(cx2);
    iy = __imag__ catan(cx2);
    printf("catan(cx2) = %.15f, %.15f\n", ry, iy);
    ry = __real__ catan(cx3);
    iy = __imag__ catan(cx3);
    printf("catan(cx3) = %.15f, %.15f\n", ry, iy);
    ry = __real__ catan(cx4);
    iy = __imag__ catan(cx4);
    printf("catan(cx4) = %.15f, %.15f\n", ry, iy);

result:
   /*
    * catan(cx1) = 1.338972522294493, 0.402359478108525
    * catan(cx2) = 1.448306995231464, 0.158997191679999
    * catan(cx3) = nan, nan
    * catan(cx4) = 1.570796326794897, -0.000000000000000
    */
搜索结果
找到“0”个结果

当前产品无相关内容

未找到相关内容,请尝试其他搜索词