X-Spam-Check-By: sourceware.org X-YMail-OSG: JCpHCgIVM1koy6lm.3sdCWodr24UXunbSD4VA9RfHrHmnvk..03hHDsLVrEbB1G89j3ju6qClRvVUsTfp4SPFlPuag-- Date: Wed, 18 Apr 2007 19:50:30 -0700 (PDT) From: "Cary R." Subject: newlib: pow function can produce incorrect results. To: cygwin AT cygwin DOT com MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <661292.26874.qm@web59109.mail.re1.yahoo.com> 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 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. The later ones may not belong here, but whoever is maintaining newlib for cygwin likely has a stronger voice with the newlib developers than I would have so I thought I would include them as well. Regards, Cary __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- 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/