emb
Newbie level 4
Hello experts,
I wrote the following lines of code in C:
I expected a value of some floating point type, but I am always getting 0 instead.
Please help me if there is anything wrong with my code and understanding.
Thanks.
IDE: Eclipse IDE for C/C++ Dev
MCU: STM32F3 series
I wrote the following lines of code in C:
Code:
int32_t num = 10267846;
int32_t den = 833;
float div_result;
div_result = num / den;
I expected a value of some floating point type, but I am always getting 0 instead.
Please help me if there is anything wrong with my code and understanding.
Thanks.
IDE: Eclipse IDE for C/C++ Dev
MCU: STM32F3 series