We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fb4194b commit e28f0cdCopy full SHA for e28f0cd
src/common/foc_utils.cpp
@@ -92,9 +92,9 @@ __attribute__((weak)) float _sqrtApprox(float number) {//low in fat
92
93
// x = number * 0.5F;
94
float y = number;
95
- long i = * ( long * ) &y;
+ uint32_t i = *reinterpret_cast<uint32_t*>(&y);
96
i = 0x5f375a86 - ( i >> 1 );
97
- y = * ( float * ) &i;
+ y = *reinterpret_cast<float*>(&i);
98
// y = y * ( f - ( x * y * y ) ); // better precision
99
return number * y;
100
}
0 commit comments