Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!samsung!uakari.primate.wisc.edu!dogie.macc.wisc.edu!decwrl!elroy.jpl.nasa.gov!cit-vax!chi From: chi@cit-vax.Caltech.Edu (Curt Hagenlocher) Newsgroups: comp.sys.mac.programmer Subject: Bug in MPW C++ ? Summary: extraction problem Message-ID: <14335@cit-vax.Caltech.Edu> Date: 18 Mar 90 00:38:37 GMT Reply-To: chi@cit-vax.caltech.edu (Curt Hagenlocher) Organization: California Institute of Technology Lines: 30 In the course of using MPW C++, I've come across the following problem. The program #include void main() { float mypi; istrstream("3.14159") >> mypi; cout << "My pi = " << mypi << "!\n" << flush; } generates My pi = 1.xxxxxE-38! or something similar (I can't remember the exact value). Interestingly enough, when I use double mypi, the program works fine. As it is, I just changed the variable to double to avoid the problem. Is this a known bug? Do I have my head up my ass about something? I haven't played much with this problem (other than to change the float to a double), but it seems that it should work. -- ...!ames!elroy!cit-vax!chi Curt Hagenlocher chi@cit-vax.caltech.edu "You can't tell me anything about South Africa, Mozambique, Angola, or anywhere and make me believe you're sincere as long as you keep quiet about what the United States is doing to us in that country." -- Malcom X