P
pw
Running this on MSWin2000 PC, I show 6 only digits for float and double.
i.e. l_float and l_double show 33333.1 (6 only digits).
Is it possible to increase/alter this?
i.e. l_float and l_double show 33333.1 (6 only digits).
Is it possible to increase/alter this?
Code:
// Test ints, floats and doubles
#include <iostream>
using namespace std;
int main()
{
int l_int;
float l_float;
double l_double;
l_int = 33333.1415922662266;
l_float = l_int;
l_double = l_int;
cout << "Define int: " << l_int << endl;
cout << "l_int: " << l_int << endl;
cout << "l_float: " << l_float << endl;
cout << "l_double: " << l_double << endl;
cout << endl;
l_float = 33333.1415922662266;
l_int = l_float;
l_double = l_float;
cout << "Define float: " << l_float << endl;
cout << "l_int: " << l_int << endl;
cout << "l_float: " << l_float << endl;
cout << "l_double: " << l_double << endl;
cout << endl;
l_double = 33333.1415922662266;
l_int = l_double;
l_float = l_double;
cout << "Define double: " << l_double << endl;
cout << "l_int: " << l_int << endl;
cout << "l_float: " << l_float << endl;
cout << "l_double: " << l_double << endl;
cout << endl;
l_double = 333333333.1415922662266;
l_int = l_double;
l_float = l_double;
cout << "Define double: " << l_double << endl;
cout << "l_int: " << l_int << endl;
cout << "l_float: " << l_float << endl;
cout << "l_double: " << l_double << endl;
cout << endl;
return 0;
}