I have a double variable with large value if I print that, it show like this
10000000000000000, how to avoid the automatic round off please help me
int main () {
double f = 9999999999999999.9999;
cout <<f;
return 0;
}
I'm not sure how many digits you can store but you might try a long double.
You might also look into the difference between int and float and then look into unsigned long long int.
Last edited on
double have about 15 decimal digits of precision
long double have about 18.
You will be better with storing whole and fractional parts in different variables.