you used for estimating inverse square root old solution and modern compiler gives me warning:
/Users/martin/Documents/Arduino/libraries/SensorFusion/src/SensorFusion.cpp: In static member function 'static float SF::invSqrt(float)':
/Users/martin/Documents/Arduino/libraries/SensorFusion/src/SensorFusion.cpp:61:20: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
long i = *(long*)&y;
^
/Users/martin/Documents/Arduino/libraries/SensorFusion/src/SensorFusion.cpp:63:16: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
y = *(float*)&i;
^
Hello,
you used for estimating
inverse square root
old solution and modern compiler gives me warning:The better way is using
union
as a trick. Thanks.