mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-25 17:25:20 +03:00
Merge pull request #11126 from mathiasvr/pr-int-exp
Use macros for power with integer exponents
This commit is contained in:
commit
00cd0e52e6
5 changed files with 6 additions and 5 deletions
|
@ -1787,7 +1787,7 @@ static void GPS_calculateDistanceFlownVerticalSpeed(bool initialize)
|
|||
int32_t dir;
|
||||
GPS_distance_cm_bearing(&gpsSol.llh.lat, &gpsSol.llh.lon, &lastCoord[GPS_LATITUDE], &lastCoord[GPS_LONGITUDE], &dist, &dir);
|
||||
if (gpsConfig()->gps_use_3d_speed) {
|
||||
dist = sqrtf(powf(gpsSol.llh.altCm - lastAlt, 2.0f) + powf(dist, 2.0f));
|
||||
dist = sqrtf(sq(gpsSol.llh.altCm - lastAlt) + sq(dist));
|
||||
}
|
||||
GPS_distanceFlownInCm += dist;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue