1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-19 06:15:16 +03:00

Minor blackbox code tidy

This commit is contained in:
Martin Budden 2017-05-02 07:13:55 +01:00
parent b8a8f6d2d8
commit 50ac13d79b
5 changed files with 48 additions and 65 deletions

View file

@ -99,6 +99,15 @@ float acos_approx(float x)
}
#endif
int gcd(int num, int denom)
{
if (denom == 0) {
return num;
}
return gcd(denom, num % denom);
}
float powerf(float base, int exp) {
float result = base;
for (int count = 1; count < exp; count++) result *= base;