HELP PLEASE!!! CRAZY COMPILERS?????
-
i need help: when i compile the following program (I have tested in bloodshed devc++, and visual c++ .net): --------------------------------------------------------------------------- #include #include #include #include using namespace std; int main() { float fnumber=1.123456789012345678; double dnumber=1.123456789012345678; long double ldnumber=1.123456789012345678; cout << "Float: " << fnumber << endl; cout << "Double: " << dnumber << endl; cout << "Long Double: " << ldnumber << endl; cout << "sizeof(float): " << sizeof(float) << endl; cout << "sizeof(double): " << sizeof(double) << endl; cout << "sizeof(long double): " << sizeof(long double) << endl; system("pause"); return 0; } ---------------------------------------------------------------------------- , the program outputs fnumber, dnumber and ldnumber (all of them) as 1.2346. i have no clue why this is happening... i am running this program on a athlon xp 2000+, under windows xp pro sp1... any help will be aprecciated...
-
i need help: when i compile the following program (I have tested in bloodshed devc++, and visual c++ .net): --------------------------------------------------------------------------- #include #include #include #include using namespace std; int main() { float fnumber=1.123456789012345678; double dnumber=1.123456789012345678; long double ldnumber=1.123456789012345678; cout << "Float: " << fnumber << endl; cout << "Double: " << dnumber << endl; cout << "Long Double: " << ldnumber << endl; cout << "sizeof(float): " << sizeof(float) << endl; cout << "sizeof(double): " << sizeof(double) << endl; cout << "sizeof(long double): " << sizeof(long double) << endl; system("pause"); return 0; } ---------------------------------------------------------------------------- , the program outputs fnumber, dnumber and ldnumber (all of them) as 1.2346. i have no clue why this is happening... i am running this program on a athlon xp 2000+, under windows xp pro sp1... any help will be aprecciated...
-
i need help: when i compile the following program (I have tested in bloodshed devc++, and visual c++ .net): --------------------------------------------------------------------------- #include #include #include #include using namespace std; int main() { float fnumber=1.123456789012345678; double dnumber=1.123456789012345678; long double ldnumber=1.123456789012345678; cout << "Float: " << fnumber << endl; cout << "Double: " << dnumber << endl; cout << "Long Double: " << ldnumber << endl; cout << "sizeof(float): " << sizeof(float) << endl; cout << "sizeof(double): " << sizeof(double) << endl; cout << "sizeof(long double): " << sizeof(long double) << endl; system("pause"); return 0; } ---------------------------------------------------------------------------- , the program outputs fnumber, dnumber and ldnumber (all of them) as 1.2346. i have no clue why this is happening... i am running this program on a athlon xp 2000+, under windows xp pro sp1... any help will be aprecciated...
-
i need help: when i compile the following program (I have tested in bloodshed devc++, and visual c++ .net): --------------------------------------------------------------------------- #include #include #include #include using namespace std; int main() { float fnumber=1.123456789012345678; double dnumber=1.123456789012345678; long double ldnumber=1.123456789012345678; cout << "Float: " << fnumber << endl; cout << "Double: " << dnumber << endl; cout << "Long Double: " << ldnumber << endl; cout << "sizeof(float): " << sizeof(float) << endl; cout << "sizeof(double): " << sizeof(double) << endl; cout << "sizeof(long double): " << sizeof(long double) << endl; system("pause"); return 0; } ---------------------------------------------------------------------------- , the program outputs fnumber, dnumber and ldnumber (all of them) as 1.2346. i have no clue why this is happening... i am running this program on a athlon xp 2000+, under windows xp pro sp1... any help will be aprecciated...
You need to tell
cout
that you want to see more digits than the default (six I think) is:[...]
long double ldnumber=1.123456789012345678;cout.precision(20);
cout << "Float: " << fnumber << endl;
[...]
Who is 'General Failure'? And why is he reading my harddisk?!?