Mail Archives: djgpp/1997/04/28/14:03:46
Subject: Time:10:26
OFFICE MEMO cout << (double), more info Date:4/28/97
As I said before, when I do
cout << 4;
I get 4.
When I do
cout << 4.5;
or
cout << (double) 4;
I get *.//////
Since this, I've determined it's not a cout or ostream problem.
If I say
double a = 4.5;
int b;
b = (int) a;
cout << a << ", " << b;
I get
*.\\\\\\, -1
Indeed, all doubles coerce to -1 as integers, and my own conversion
routine gives a bunch of '\' for floating output.
It's as if I wasn't linked to some floating library or including some
floating point support header file, but there's no mention of such things
in the FAQs or other documentation, that I've found. I did add 387
emulation to the go32 environment although I'm running a 486 SX and it
seemed like it shouldn't be necessary. In any case, it didn't change
anything.
Courtney DOT Duncan AT Jpl DOT Nasa DOT Gov
- Raw text -