I have problem with scanf function in C.
I want read double value 0.01 from keyboard (in console application) but when i try to print this value on screen it returns 0.01000000000000000021 and i have no idea why. I need exact 0.010000000000000
My sample test code looks like this:
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main(int argc, char** argv) {
double value;
printf("Write double value:\n");
scanf("%lf", &value);
printf("%.20f", value);
return(EXIT_SUCCESS);
}
Can someone help me?