You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was compiling my code with -Wdouble-promotion and noticed these warnings:
[...]/src/peripherals/mpl3115.c: In function 'MPL3115ReadBarometer':
[...]/src/peripherals/mpl3115.c:266:51: warning: implicit conversion from 'float' to 'double' to match other operand of binary expression [-Wdouble-promotion]
float decimal = ( ( float )( lsb >> 4 ) ) / 16.0;
^
[...]/src/peripherals/mpl3115.c:275:42: warning: implicit conversion from 'float' to 'double' to match other operand of binary expression [-Wdouble-promotion]
float decimal = ( ( float )lsb ) / 4.0;
^
Assuming those are not intentional, it should be 16.0f / 4.0f instead.
The text was updated successfully, but these errors were encountered:
I was compiling my code with
-Wdouble-promotion
and noticed these warnings:Assuming those are not intentional, it should be
16.0f
/4.0f
instead.The text was updated successfully, but these errors were encountered: