From: Damian Yerrick Newsgroups: comp.os.msdos.djgpp Subject: Re: Weird results of log( -1.0 ) with libm.a and without libm.a Organization: Pin Eight Software http://pineight.8m.com/ Message-ID: References: <3a5e8f24$1 AT rpc1284 DOT daytonoh DOT ncr DOT com> <6480-Fri12Jan2001134540+0200-eliz AT is DOT elta DOT co DOT il> <3a62680d AT rpc1284 DOT daytonoh DOT ncr DOT com> X-Newsreader: Forte Agent 1.7/32.534 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 28 X-Trace: /KHlxN3IVOdahnnnNT6BhV9Ft5yphOmPTk8eccPlKo2eKVoBDap4oq9jMpKqFiHQfBidiVgwvPL+!Nl7exC+EzxqrLeXpJuqyB0gLYb/J47GwJuZsGWqVs/rBgdFNjirFmbeQITcKutAvcRSYnkcgbep9!BLC70A== X-Complaints-To: abuse AT gte DOT net X-Abuse-Info: Please be sure to forward a copy of ALL headers X-Abuse-Info: Otherwise we will be unable to process your complaint properly NNTP-Posting-Date: Wed, 17 Jan 2001 03:35:25 GMT Distribution: world Date: Wed, 17 Jan 2001 03:35:25 GMT To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com On Mon, 15 Jan 2001 10:00:49 +0700, "Tanes Sriviroolchai" wrote: >"Eli Zaretskii" wrote in message >news:6480-Fri12Jan2001134540+0200-eliz AT is DOT elta DOT co DOT il... >> >> You should be able to look at the bit pattern of the result and >> compare it with NaN and Inf, if you don't believe isnan. > >No, I'm ok with all behavior of log() and isnan() in DJGPP. The only >(small) problem is isnan() is not available in libc.a. Get the libm sources (djlsr203.zip from Simtel) and pull out isnan() if you feel that strongly. >However, I can compare the result directly with NaN and Inf You can't just do if(x == 0./0.) because there are several types of NaN; each has a different non-zero characteristic. +Inf can be considered a NaN with a characteristic of all zero bits. --