www.delorie.com/archives/browse.cgi | search |
From: | Martin Stromberg <eplmst AT epl DOT ericsson DOT se> |
Message-Id: | <200211081254.NAA18624@lws256.lu.erisoft.se> |
Subject: | Re: Weird ceil() and other results |
To: | djgpp-workers AT delorie DOT com |
Date: | Fri, 8 Nov 2002 13:54:42 +0100 (MET) |
In-Reply-To: | <005501c2871e$2a5b9990$0100a8c0@p4> from "Andrew Cottrell" at Nov 08, 2002 10:57:47 PM |
X-Mailer: | ELM [version 2.5 PL3] |
MIME-Version: | 1.0 |
Reply-To: | djgpp-workers AT delorie DOT com |
Errors-To: | nobody AT delorie DOT com |
X-Mailing-List: | djgpp-workers AT delorie DOT com |
X-Unsubscribes-To: | listserv AT delorie DOT com |
> > If I comment out the #include <math.h> from the program below then the > program compiles and links without any errors or warnings. The results are:- > date = 52.680000 > date = 51.680000 > decimalPart = 1072705824.000000 > wholePart = 1077938047.000000 > down = 1077939071.000000 > > If I include the #inclue <math.h> from the program below then the program > compiles and links without any errors or warnings. The results are:- > date = 52.680000 > date = 51.680000 > decimalPart = 0.680000 > wholePart = 51.000000 > down = 52.000000 > > These results are correct.... > > Does anyone know why I would get wrong results, but no error messages if I > do not include math.h? I would have expected to get error messages > indicating a problem rather than a bad exe. The reason it breaks when it breaks is that undeclared functions in C defaults to returning int. So when something else than int is returned things breaks. Does "-Wall" generate a warning message? Right, MartinS
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |