Return to BSD News archive
Newsgroups: comp.unix.bsd Path: sserve!manuel!munnari.oz.au!sgiblab!darwin.sura.net!Sirius.dfn.de!chx400!bernina!torda From: torda@igc.ethz.ch (Andrew Torda) Subject: gcc floating point parsing - bug [386bsd] Message-ID: <1992Sep19.074323.26834@bernina.ethz.ch> Keywords: gcc floating point Sender: news@bernina.ethz.ch (USENET News System) Organization: Computational Chemistry, ETH, Zuerich Date: Sat, 19 Sep 1992 07:43:23 GMT Lines: 23 I can't see what I am doing wrong here. gcc seems to be parsing floating point numbers incorrectly. Look at the following two lines and what happens when I compile and run them : -------------------- #include <stdio.h> void main() { printf (" 0.0 is %f and 0. is %f\n", 0.0, 0.); } % cc -o float float.c ; float 0.0 is -1.000000 and 0. is 0.000000 -------------------- Am I doing something terribly wrong ? Don't think so. I kept stumbling into badly initialised variables while working on another package. I am more confused since gcc 1.xx doesn't have this problem on other machines. Any comments ? -Andrew -- Andrew Torda, Computational Chemistry, ETH, Zurich, torda@igc.ethz.ch