User forums > General (but related to Code::Blocks)
GCC 4.1.2 available (now relocatable!)
Biplab:
If you don't mind, what is the difference between this build and the earlier one. :?
TDragon:
--- Quote from: Biplab on February 27, 2007, 06:13:14 pm ---If you don't mind, what is the difference between this build and the earlier one.
--- End quote ---
It may be installed anywhere (not restricted to C:\MinGW), without needing to add the additional directories I'd mentioned previously to Code::Blocks' compiler search paths. (Note: I haven't yet tried installing it in a path with spaces, such as "Program Files".)
Biplab:
Understood.. :)
kylove:
GCC 4.1.2 Bug
//code
#include <iostream>
using namespace std;
int main()
{
long double pi=3.141592653589793;
cout<<"pi=="<<pi<<endl;
return 0;
}
//Run
pi==-8.87961e+043
//Why?
TDragon:
--- Quote from: kylove on February 28, 2007, 02:04:44 pm ---//Why?
--- End quote ---
After some poking around, I can only say I don't know. Something I find interesting is that GCC 3.4.5's std::cout performs as expected, but its printf() exhibits the same behavior as 4.1.2's cout (and printf). This points to changes in libstdc++.
The problem is only with the output's formatting, as the following program works as expected:
--- Code: ---#include <iostream>
int main()
{
long double pi = 3.141592653589793L;
int add;
std::cin >> add;
std::cout << "add: " << add << "\npi + add: " << (double)(pi + add) << std::endl;
return 0;
}
--- End code ---
Note the cast to double -- cout appears to correctly interpret doubles. I believe this program proves that the long double's internal representation is correct.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version