I wanted to see the difference in how many digits i get when using float and when using double but i get the same results
#include <stdio.h>
int main()
{
float x=1.2222222222222222f;
printf("%f %d", x,sizeof(x)); // This is what it prints out 1.222222 4
return 0;
}
#include <stdio.h>
int main()
{
double x=1.2222222222222222;
printf("%f %d", x,sizeof(x)); // This is what it prints out 1.222222 8
return 0;
}
It prints out the same value even tho double is obviously double the size and should save more digits. What am i doing wrong?