Rate This Document
Findability
Accuracy
Completeness
Readability

powr8i4

Compute the value of an 80-bit precision-scalable exponential function.

Interface Definition

C interface:

double powr8i4(double x, int y);

Parameters

Parameter

Type

Description

Input/Output

x

Double-precision floating-point type

Floating-point value of the input data

Input

y

Integer

Integer value of the input data

Input

Return Values

  • If x is any value and y is 0, 1.0 is returned.
  • If x is INF and y is a positive integer, INF is returned.
  • If x is INF and y is a negative integer, 0.0 is returned.
  • If x is -INF and y is a positive odd number, -INF is returned.
  • If x is -INF and y is a positive even number, INF is returned.
  • If x is -INF and y is a negative odd number, -0.0 is returned.
  • If x is -INF and y is a negative even number, 0.0 is returned.
  • If x is NAN and y is any value, NAN is returned.
  • If x is -0.0 and y is a negative integer, -INF is returned.
  • If x is 0.0 and y is a negative integer, INF is returned.
  • If x is a large finite number and y is a large integer, +/-INF is returned.

Dependencies

C: "km.h"

Examples

C interface:

   // typical usage 
    double  x1 = 1.0, x2 = 2.0, x3 = 3.0, x4 = 4.0;
    int  y1 = 4, y2 = -4, y3 = -3, y4 = 3;
    // special handing 
    double a = INFINITY, b = -INFINITY, c = NAN, d = 0.0; 
    // print result 
    printf("pow(1.0, 4) = %.15f\n", pow(x1, y1));
    printf("pow(2.0, -4) = %.15f\n", pow(x2, y2));
    printf("pow(3.0, -3) = %.15f\n", pow(x3, y3));
    printf("pow(4.0, 3) = %.15f\n", pow(x4, y4));
    printf("pow(INFINITY, 4) = %+.15f\n", pow(a, y1));
    printf("pow(INFINITY, -4) = %+.15f\n", pow(a, y2));
    printf("pow(-INFINITY, -3) = %+.15f\n", pow(b, y3));
    printf("pow(NAN, 3) = %+.15f\n", pow(c, y4));
    printf("pow(0.0, -3) = %+.15f\n", pow(d, y3));
    printf("pow(-0.0, -3) = %+.15f\n", pow(e, y3));
    /* 
     *  pow(1.0, 4) = 1.000000000000000
     *  pow(2.0, -4) = 0.062500000000000
     *  pow(3.0, -3) = 0.037037037037037
     *  pow(4.0, 3) = 64.000000000000000
     *  pow(INFINITY, 4) = inf
     *  pow(INFINITY, -4) = 0.000000000000000
     *  pow(-INFINITY, -3) = -0.000000000000000
     *  pow(NAN, 3) = nan
     *  pow(0.0, -3) = inf
     *  pow(-0.0, -3) = -inf
     * 
     * */