I've experienced a problem when using roundl()
I've made a function like:
double_t cents(double_t amount)
return roundl(amount * 100.0L)/100.0L;
I happen to print each of these returned rounded values and accumulate
the returned values as well.
At the end I round the accumulated sum and print that too.
Now I experience the printed sum is not the same as the sum of each
I print the values using a function similar to:
printf("%"PRIdMAX, llroundl(value * 100)); /* value is double_t */
Well, rounding problems are understandable, if the number of values are
large and/or if the values have 'strange' magnitudes, but I have only 20
values in the range from 0.00 to < 10000.00.
This problem does not seem to exist on Linux, only on Windows.
Has anyone experienced similar problems using MinGW?