I have two long long (int) values, and I want to print their division in float format with 3 digits precision. I have already read
printf and long double , but all those suggestions lead to nan
as the result of printf.
E.g.
long long a = 123123123;
long long b = 123123124;
printf("%d\n", b/a);
printf("%.3f", b/a);
The first print will output 1
(as expected), but the second 0.000
instead of 1.xxx