one example of my problem.
#include <stdio.h>
#include <math.h>
int main() {
long double mod = fmod(0.06, 0.02);
printf("%Le", mod); //prints 2.000000e-02 instead of 0.000000e+00.
long double mod1 = fmod(0.006, 0.002);
printf("%Le", mod1); //prints 0.000000e+00 correct.
return 0;
}
how can i solve than problem, i tried to use fmodf()
and fmodl()
but i have the same problem on another values.
i have to work with long double so is there some way to solve that...