Date: Sun, 25 Jan 1998 11:46:15 +0200 (IST) From: Eli Zaretskii To: Jeff Taylor cc: djgpp AT delorie DOT com Subject: Re: math functions In-Reply-To: <34CA750A.7715@cyber-quest.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Sat, 24 Jan 1998, Jeff Taylor wrote: > For pow(1.000336, -5) I get Infinity. Is this outside the range of > pow? > For gamma(5) I get 3.178, I'm expecting 24. Are there two functions > called gamma functions? The most probably cause for this seemingly strange behavior is that you fail to include . This leaves GCC with no prototype of `pow' and `gamma', and so it doesn't convert the integer values like 5 and -5 into doubles, which is what these functions expect. This can certainly produce some weird results, and even crash your program. You should always include when you work with math functions. I would also suggest to use double constants, like 5.0 and -5.0, instead of integers. This could save you hours of debugging in some cases.