Could you please explain this code:
printf("Value1: %0.1f \n", (float)124/100); // = 1.2
printf("Value1: %0.1f \n", (float)125/100); // = 1.2
printf("Value1: %0.1f \n", (float)126/100); // = 1.3
printf("\n");
printf("Value2: %0.1f \n", (float)134/100); // = 1.3
printf("Value2: %0.1f \n", (float)135/100); // = 1.4
printf("Value2: %0.1f \n", (float)136/100); // = 1.4
Why is the number 125 rounding down to 1.2 and 135 rounding up to 1.4? For example, it also happens with the numbers 105, 115, 125, 155, 165.