Rate This Document
Findability
Accuracy
Completeness
Readability

pow2o3

Compute the value of x raised to the power of 2/3.

Interface Definition

C interface:

float pow2o3f(float x);

double pow2o3(double x);

Parameters

Parameter

Type

Description

Input/Output

x

  • For pow2o3f, x is of single-precision floating-point type.
  • For pow2o3, x is of double-precision floating-point type.

Floating-point value of the input data.

Input

Return Value

  • If input x is ±0, the return value is +0.
  • If input x is +∞, the return value is +∞.
  • If input x is -∞, the return value is +∞.
  • If input x is NaN, the return value is NaN.

Dependency

C: "km.h"

Example

C interface:
    // typical usage
    double x1 = 0.0, x2 = -0.0, x3 = 1.5, x4 = -2.5;
    // special handing
    double a = INFINITY, b = -INFINITY, c = NAN;
    // print result
    printf("pow2o3(0.0) = %.15f\n", pow2o3(x1));
    printf("pow2o3(-0.0) = %.15f\n", pow2o3(x2));
    printf("pow2o3(1.5) = %.15f\n", pow2o3(x3));
    printf("pow2o3(-2.5) = %.15f\n", pow2o3(x4));
    printf("pow2o3(INFINITY) = %.15f\n", pow2o3(a));
    printf("pow2o3(-INFINITY) = %.15f\n", pow2o3(b));
    printf("pow2o3(NAN) = %.15f\n", pow2o3(c));
    /* 
     *  pow2o3(0.0) = 0.000000000000000
     *  pow2o3(-0.0) = 0.000000000000000
     *  pow2o3(1.5) = 1.310370697104448
     *  pow2o3(-2.5) = 1.842015749320193
     *  pow2o3(INFINITY) = inf
     *  pow2o3(-INFINITY) = inf
     *  pow2o3(NAN) = nan
     * */