I would like to improve the precision of a double. It seems the precision of double and float is the same. (I also need a better precision for my future c++ plans.)
I have no clue how to do this.
#include <iostream>
using namespace std;
int main()
{
double fraction1 = 0.123467890123456789;
float fraction2 = 0.123467890123456789;
cout << fraction1 << endl;
cout << fraction2 << endl;
return 0;
}
This yields:
0.123468
0.123468
I would have expected something like a precision of 10 or more digits.