delorie.com/archives/browse.cgi | search |
X-Spam-Check-By: | sourceware.org |
X-YMail-OSG: | eGDFCyQVM1nhJPcRp6V.fsGEcFX6ssp8gj7JvI1k3K05uc8TyMSBPc5Bh6bFdpSx2LKtW8GH49zLE7s8MHIZupbp_9uNb3Mr_WLunZDLLaYYVM2ppzCePELq7BZ_wHpM |
Date: | Mon, 23 Apr 2007 16:52:43 -0700 (PDT) |
From: | "Cary R." <cygcary AT yahoo DOT com> |
Subject: | Re: newlib?: pow function can produce incorrect results. |
To: | cygwin AT cygwin DOT com |
MIME-Version: | 1.0 |
Message-ID: | <17190.86623.qm@web59108.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 |
--0-1884113354-1177372363=:86623 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Id: Content-Disposition: inline I had some more time to look into this and when the simple C program I mentioned earlier uses variables like the other program, incorrect results are produced. I have attached this C/C++ program. I certainly don't understand what is going on. I would have expected pow to be pass-by value which should make the two calls identical from a system standpoint, but the results imply something different. Any suggestions would be greatly appreciated. Cary __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com --0-1884113354-1177372363=:86623 Content-Type: application/octet-stream; name="pow-error.c" Content-Transfer-Encoding: base64 Content-Description: 3225223843-pow-error.c Content-Disposition: attachment; filename="pow-error.c" I2luY2x1ZGUgPG1hdGguaD4KI2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgbWFp bigpCns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VjdCByZXN1bHRzIQogIHByaW50 ZigiLCAlZi5cbiIsIHZhcik7CgogIHJldHVybiAwOwp9Cg== --0-1884113354-1177372363=:86623 Content-Type: text/plain; charset=us-ascii -- 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/ --0-1884113354-1177372363=:86623--
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |