X-Spam-Check-By: sourceware.org X-YMail-OSG: yoTSLygVM1lz5wAAik6IETROgxDAnmkTjKt0SeD66tn6PMCfP7gpj3ukP9kweIuaMz37scbs0.gOWkP06bdp5nHaLGrfpkNryjcXCo1vRYRfeCGqW10- Message-ID: <4626DFB8.2010805@aol.com> Date: Wed, 18 Apr 2007 20:19:20 -0700 From: Tim Prince 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: newlib: pow function can produce incorrect results. References: <661292 DOT 26874 DOT qm AT web59109 DOT mail DOT re1 DOT yahoo DOT com> In-Reply-To: <661292.26874.qm@web59109.mail.re1.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , 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'm not certain if this is a newlib compilation flag > problem, something that has been fixed in the 1.15 > version of newlib or just that newlib does things > differently. Looking at the 1.15 code implies that > some of these should work and the rest appear to be a > deviation from other systems. I tested this on my RH > Linux enterprise 3 machine and got the expected > results for everything. My cygwin is up to date. > > First the ones that the 1.15 code says should work > correctly: pow(1.0, nan) and pow(nan, 0.0) both should > return 1.0. I'm currently getting nan for both of > them. > > The other ones are pow(1.0, inf), pow(-1.0, inf), > pow(1.0, -inf) and pow(-1.0, -inf) which I believe > should all return 1.0 as well. They are also returning > nan. What's interesting about these are that if you > look at > http://www.opengroup.org/onlinepubs/009695399/functions/pow.html > it describes exactly how to handle every case of x ^ > inf except for the case of positive 1. Maybe they are > assuming we all remember that 1 raised to any power is > 1. > gcc has more serious conflicts with OpenGroup than this. For example, PR31340 about the conflict between gcc testsuite cases and the OpenGroup raise() function, causing unjustified failure on cygwin. I don't see how pow(-1., inf) could be defined this way, unless you take the position that inf must have an even integral value. These don't fall out as byproducts of a reasonable implementation; many of these would require special casing. I didn't think newlib tries to implement NaN or Inf behaviors anyway. Certainly, not much C99 is supported. Do you have references on these points? -- 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/