CACOS - Linux手册页

时间:2019-08-20 17:59:57  来源:igfitidea点击:

Linux程序员手册 第3部分
更新日期: 2020-06-09

名称

cacos,cacosf,cacosl-复杂反余弦

语法

#包括

double complex cacos(double complex z);
float complex cacosf(float complex z);
长双络合物可可(长双络合物z);

与-lm链接。

说明

这些函数计算z的复数反余弦。如果y = cacos(z),则z = ccos(y)。 y的实部在间隔[0,pi]中选择。

一个具有:

cacos(z) = -i * clog(z + i * csqrt(1 - z * z))

版本

这些功能首先出现在2.1版的glibc中。

属性

有关本节中使用的术语的说明,请参见attribute(7)。

InterfaceAttributeValue
cacos(),cacosf(),cacosl()Thread safetyMT-Safe

遵循规范

C99,POSIX.1-2001,POSIX.1-2008。

示例

/* Link with "-lm" */

#include <complex.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>

int
main(int argc, char *argv[])
{
    double complex z, c, f;
    double complex i = I;

    if (argc != 3) {
        fprintf(stderr, "Usage: %s <real> <imag>\n", argv[0]);
        exit(EXIT_FAILURE);
    }

    z = atof(argv[1]) + atof(argv[2]) * I;

    c = cacos(z);

    printf("cacos() = %6.3f %6.3f*i\n", creal(c), cimag(c));

    f = -i * clog(z + i * csqrt(1 - z * z));

    printf("formula = %6.3f %6.3f*i\n", creal(f), cimag(f));

    exit(EXIT_SUCCESS);
}

另外参见

ccos(3),clog(3),复杂(7)

出版信息

这个页面是Linux手册页项目5.08版的一部分。有关项目的说明、有关报告错误的信息以及此页面的最新版本,请访问https://www.kernel.org/doc/man-pages/