delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/04/29/07:52:57

Newsgroups: comp.os.msdos.djgpp
Date: Wed, 29 Apr 1998 13:47:49 +0200 (MET DST)
From: Alex <alex AT gamf DOT hu>
To: Kbwms <Kbwms AT aol DOT com>
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: <Pine.GSO.3.96.980429134008.19481A-100000@Gandalf.gamf.hu>
References: <2cd092ba DOT 353f5d4a AT aol DOT com>
MIME-Version: 1.0

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019