mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-31 21:18:29 -04:00
ce53ae63ae
MdB says: dividing by 2 is actually optimal. It's type correct for all usage, and the compiler generates the multiplication if it's float, and sticks with divide for integers Godbolt indicates on any optimization level (O1-O3, and Os) that the compiler will correctly optimize the / 2 into a float multiplication if using a float, but if using integer types in the template it will stick with the / 2 which is faster then doing the conversions to/from float. |
||
---|---|---|
.. | ||
benchmarks | ||
examples | ||
tests | ||
tools/geodesic_grid | ||
AP_GeodesicGrid.cpp | ||
AP_GeodesicGrid.h | ||
AP_Math.cpp | ||
AP_Math.h | ||
crc.cpp | ||
crc.h | ||
definitions.h | ||
edc.cpp | ||
edc.h | ||
location_double.cpp | ||
location.cpp | ||
location.h | ||
matrix3.cpp | ||
matrix3.h | ||
matrix_alg.cpp | ||
matrixN.cpp | ||
matrixN.h | ||
polygon.cpp | ||
polygon.h | ||
quaternion.cpp | ||
quaternion.h | ||
rotations.h | ||
spline5.cpp | ||
spline5.h | ||
vector2.cpp | ||
vector2.h | ||
vector3.cpp | ||
vector3.h | ||
vectorN.h |