We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 425b077 commit ec1138eCopy full SHA for ec1138e
0050_pow/pow.c
@@ -2,15 +2,16 @@
2
#include <stdio.h>
3
#include <stdlib.h>
4
5
-static double fast_pow(double x, int n)
+
6
+double fast_pow(double x, int n)
7
{
8
if (n == 0) { return 1.0; }
9
if (n == 1) { return x; }
10
double t = fast_pow(x, n / 2);
11
return n & 1 ? t * t * x : t * t;
12
}
13
-static double my_pow(double x, int n)
14
+double my_pow(double x, int n)
15
16
if (n == INT_MIN) {
17
double t = 1 / fast_pow(x, -(n / 2));
0 commit comments