Loading...
Searching...
No Matches
int_power.c
Go to the documentation of this file.
#include "grib2_int.h"
double
int_power(double x, g2int y)
{
double value;
if (y < 0)
{
y = -y;
x = 1.0 / x;
}
value = 1.0;
while (y)
{
if (y & 1)
{
value *= x;
}
x = x * x;
y >>= 1;
}
return value;
}
g2int
int64_t g2int
Long integer type.
Definition grib2.h:32
grib2_int.h
Header file with internal function prototypes NCEPLIBS-g2c library.
int_power
double int_power(double x, g2int y)
Function similar to C pow() power function.
Definition int_power.c:18