delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/04/28/14:03:46

Message-ID: <n1349898145.92491@jpl-335-server.jpl.nasa.gov>
Date: 28 Apr 1997 10:41:42 -0800
From: "Courtney Duncan" <Courtney.Duncan.JPL#u#335#u#QMAIL AT jpl-335-server DOT jpl DOT nasa DOT gov>
Subject: cout << (double), more info
To: "djgpp list" <djgpp AT delorie DOT com>
Mime-Version: 1.0

                       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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019