Newsgroups: comp.os.msdos.djgpp Date: Wed, 29 Apr 1998 13:47:49 +0200 (MET DST) From: Alex To: Kbwms cc: djgpp AT delorie DOT com Subject: Re: Problems with paranoia.c and pow(0,0) In-Reply-To: <2cd092ba.353f5d4a@aol.com> Message-ID: References: <2cd092ba DOT 353f5d4a AT aol DOT com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk Hi you all and K.B. Williams, I am using Djgpp in this days I had complete a graphical program witch used the function pow(x,y). I got always floating point exception, first I didn't know what the problem was, but later I discovered the pow(0,0) is not number that is uncountable. Try it on a calculator You will see! So, don't want to try to compute it. This a math rule as I discovered. Somehow you can trap this exception. Alex. >The program is actually trying to compute pow(0,0). Where the number 1023 >comes from is a mystery. > >pow(0,0) = NaN > >Note that the call to pow() had to be surrounded by calls to _fpreset() >to prevent an abort printout like this: > >Calculating 0^0 should produce 1. > >K.B. Williams