Here is simple code for stm32f4
void main(void)
{
float sum = 1.0;
uint32_t cnt = 0;
while(1)
{
for( cnt = 0; cnt < 1000; cnt++ )
sum += 2.0e-08;
printfUsart("%f\r\n",
sum
);
}
}
There is no changes of variable sum
value.
If i summarize in loop this value: sum += 2.0e-07;
it increase.
I use "gcc-arm-none-eabi-4_9-2014q4" compiler with this compile and linker flags:
PROCESSOR = -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16
So, how work with ultra small float values? I need it to implement Matlab generated code in stm32f4 firmware to realize some filtering functions.