equal
deleted
inserted
replaced
1 #include "pmath.h" |
1 #include "pmath.h" |
2 #include <stdlib.h> |
2 #include <stdlib.h> |
3 #include <math.h> |
3 #include <math.h> |
4 |
|
5 /* |
|
6 * power raises base to the power power. |
|
7 * This is equivalent to exp(power*ln(base)). Therefore base should be non-negative. |
|
8 */ |
|
9 float fpcrtl_power(float base, float exponent) |
|
10 { |
|
11 return exp(exponent * log(base)); |
|
12 } |
|
13 |
4 |
14 /* Currently the games only uses sign of an integer */ |
5 /* Currently the games only uses sign of an integer */ |
15 int fpcrtl_signi(int x) |
6 int fpcrtl_signi(int x) |
16 { |
7 { |
17 if(x > 0){ |
8 if(x > 0){ |