GDC not handling floats correctly
Status: Alpha
Brought to you by:
dvdfrdmn
When compiling the following code:
module floattest;
import tango.io.Stdout;
void main(){
float x = 3.14;
double y = 3.14;
Stdout(x).newline;
Stdout(y).newline;
Stdout(cast(double)x).newline;
}
and running it, the following output is produced:
2.14
3.14
3.14
This is not a problem with Tango, because tango users using dmd do not have this problem. I am on Mac OS 10.4 using the latest gdcmac distribution.
Logged In: YES
user_id=1286246
Originator: NO
I tried this and got mixed results for 32bit and 64bit.
On 32bit architecture (Ubuntu Hardy i386):
3.68e+19
3.14
3.14
On 64bit architecture (Ubuntu Hardy amd64):
3.14
3.14
3.14
So it seems to to the right job when gdc compiles for 64bit architectures. Hmmm...