This question already has an answer here:
- C program division error? 7 answers
I am working with STM32 and GCC Compiler and I make the following division:
uint8_t w, h;
w=2;
h=5;
float test = (w * h) / 8;
and the result is test=1
Why am I wrong? I cannot understand this behavior.
Could someone explain me the reason?