delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/04/19/21:24:40

X-Spam-Check-By: sourceware.org
X-YMail-OSG: yTaIz5gVM1kNuJ2qZexK6GEnBow57dyULfbjAk5DsnFQve7okz7kp2uEfdaNEPUxWeTo2WfzIg--
Message-ID: <4628163D.2080407@aol.com>
Date: Thu, 19 Apr 2007 18:24:13 -0700
From: Tim Prince <n8tm AT aol DOT com>
Reply-To: tprince AT computer DOT org
User-Agent: Thunderbird 1.5.0.10 (Windows/20070221)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: <OT> newlib: pow function can produce incorrect results.
References: <392691 DOT 10784 DOT qm AT web59113 DOT mail DOT re1 DOT yahoo DOT com>
In-Reply-To: <392691.10784.qm@web59113.mail.re1.yahoo.com>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

cygcary AT yahoo DOT com wrote:
> I do agree that
> -1.0 to either +-infinity should be a nan, but then
> using that same logic why is -1.1 to infinity and 0.9
> to minus infinity equal to infinity and not nan?
> Personally I don't really care which way it's done. I
> just would like things to be consistent.

pow() since the very beginning treats negative integral values different 
from other negative values, so you can't make them totally consistent. 
Maybe you should stick to Fortran or BASIC.
pow(0.9, -Inf) clearly must produce Inf, same as 1/pow(0.9, Inf).
pow(-1.1, Inf) should be NaN, but again, newlib doesn't generally go 
beyond minimum C90 support.  As newlib doesn't go very far in the 
direction of C99 or IEEE754 support, it is out of the realm of cygwin.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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