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

clog10

计算复数以10为底数的对数值。

接口定义

C interface:

float complex clog10f(float complex x);

double complex clog10(double complex x);

long double complex clog10l(long double complex x);

参数

参数名

类型

描述

输入/输出

x

  • 在clog10f中,x是复数单精度浮点类型。
  • 在clog10中,x是复数双精度浮点类型。
  • 在clog10l中,x是复数长双精度浮点类型。

表示输入数据的浮点值。

输入

返回值

  • 返回x的以10为底的对数值结果y。
  • 特殊值说明如下所示。

    输入值实部(x.real)

    输入值虚部(x.imag)

    输出值实部(y.real)

    输出值虚部(y.imag)

    +0

    +0

    -inf

    +0

    +0

    -0

    -inf

    -0

    +0

    inf

    inf

    0x3fe5d47c4cb2fba1(pi/2ln10)

    +0

    -inf

    inf

    0xbfe5d47c4cb2fba1(-pi/2ln10)

    +0

    snan

    nan

    nan

    +0

    -snan

    nan

    nan

    +0

    qnan

    nan

    nan

    +0

    -qnan

    nan

    nan

    -0

    +0

    -inf

    0x3ff5d47c4cb2fba1(pi/ln10)

    -0

    -0

    -inf

    0xbff5d47c4cb2fba1(-pi/ln10)

    -0

    inf

    inf

    0x3fe5d47c4cb2fba1(pi/2ln10)

    -0

    -inf

    inf

    0xbfe5d47c4cb2fba1(-pi/2ln10)

    -0

    snan

    nan

    nan

    -0

    -snan

    nan

    nan

    -0

    qnan

    nan

    nan

    -0

    -qnan

    nan

    nan

    inf

    +0

    inf

    +0

    inf

    -0

    inf

    -0

    inf

    inf

    inf

    0x3fd5d47c4cb2fba1(pi/4ln10)

    inf

    -inf

    inf

    0xbfd5d47c4cb2fba1(-pi/4ln10)

    inf

    snan

    inf

    nan

    inf

    -snan

    inf

    nan

    inf

    qnan

    inf

    nan

    inf

    -qnan

    inf

    nan

    -inf

    +0

    inf

    0x3ff5d47c4cb2fba1(pi/ln10)

    -inf

    -0

    inf

    0xbff5d47c4cb2fba1(-pi/ln10)

    -inf

    inf

    inf

    0x3ff05f5d39863cb9(3*pi/4ln10)

    -inf

    -inf

    inf

    0xbff05f5d39863cb9(-3*pi/4ln10)

    -inf

    snan

    inf

    nan

    -inf

    -snan

    inf

    nan

    -inf

    qnan

    inf

    nan

    -inf

    -qnan

    inf

    nan

    snan

    +0

    nan

    nan

    snan

    -0

    nan

    nan

    snan

    inf

    inf

    nan

    snan

    -inf

    inf

    nan

    snan

    snan

    nan

    nan

    snan

    -snan

    nan

    nan

    snan

    qnan

    nan

    nan

    snan

    -qnan

    nan

    nan

    -snan

    +0

    nan

    nan

    -snan

    -0

    nan

    nan

    -snan

    inf

    inf

    nan

    -snan

    -inf

    inf

    nan

    -snan

    snan

    nan

    nan

    -snan

    -snan

    nan

    nan

    -snan

    qnan

    nan

    nan

    -snan

    -qnan

    nan

    nan

    qnan

    +0

    nan

    nan

    qnan

    -0

    nan

    nan

    qnan

    inf

    inf

    nan

    qnan

    -inf

    inf

    nan

    qnan

    snan

    nan

    nan

    qnan

    -snan

    nan

    nan

    qnan

    qnan

    nan

    nan

    qnan

    -qnan

    nan

    nan

    -qnan

    +0

    nan

    nan

    -qnan

    -0

    nan

    nan

    -qnan

    inf

    inf

    nan

    -qnan

    -inf

    inf

    nan

    -qnan

    snan

    nan

    nan

    -qnan

    -snan

    nan

    nan

    -qnan

    qnan

    nan

    nan

    -qnan

    -qnan

    nan

    nan

依赖

C: "kc.h"

示例

C interface:
    // typical usage
    double x1 = INFINITY, y1 = INFINITY;
    double x2 = 2.0, y2 = 3.0;
    double x3 = -2.5, y3 = -3.4;
    double x4 = NAN, y4 = NAN;
    double x5 = 0, y5 = 0;
    double complex z1 = clog10(__builtin_complex(x1, y1));
    double complex z2 = clog10(__builtin_complex(x2, y2));
    double complex z3 = clog10(__builtin_complex(x3, y3));
    double complex z4 = clog10(__builtin_complex(x4, y4));
    double complex z5 = clog10(__builtin_complex(x5, y5));
    // print result
    printf("/*\n");
    printf(" * clog10(%.2f + %.2f*I) = %.6f + %.6f*I\n", x1, y1, __real__(z1), __imag__(z1));
    printf(" * clog10(%.2f + %.2f*I) = %.6f + %.6f*I\n", x2, y2, __real__(z2), __imag__(z2));
    printf(" * clog10(%.2f + %.2f*I) = %.6f + %.6f*I\n", x3, y3, __real__(z3), __imag__(z3));
    printf(" * clog10(%.2f + %.2f*I) = %.6f + %.6f*I\n", x4, y4, __real__(z4), __imag__(z4));
    printf(" * clog10(%.2f + %.2f*I) = %.6f + %.6f*I\n", x5, y5, __real__(z5), __imag__(z5));
    printf(" **/\n");
    /*
     * clog10(inf + inf*I) = inf + 0.341094*I
     * clog10(2.00 + 3.00*I) = 0.556972 + 0.426822*I
     * clog10(-2.50 + -3.40*I) = 0.625332 + -0.957541*I
     * clog10(nan + nan*I) = nan + nan*I
     * clog10(0.00 + 0.00*I) = -inf + 0.000000*I
     **/
搜索结果
找到“0”个结果

当前产品无相关内容

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