NCEPLIBS-g2c 2.0.0
Loading...
Searching...
No Matches
int_power.c
Go to the documentation of this file.
1
5#include "grib2_int.h"
6
17double
18int_power(double x, g2int y)
19{
20 double value;
21
22 if (y < 0)
23 {
24 y = -y;
25 x = 1.0 / x;
26 }
27 value = 1.0;
28
29 while (y)
30 {
31 if (y & 1)
32 {
33 value *= x;
34 }
35 x = x * x;
36 y >>= 1;
37 }
38 return value;
39}
int64_t g2int
Long integer type.
Definition grib2.h:32
Header file with internal function prototypes NCEPLIBS-g2c library.
double int_power(double x, g2int y)
Function similar to C pow() power function.
Definition int_power.c:18