www.delorie.com/archives/browse.cgi | search |
Mailing-List: | contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm |
Sender: | cygwin-owner AT sourceware DOT cygnus DOT com |
Delivered-To: | mailing list cygwin AT sourceware DOT cygnus DOT com |
Message-Id: | <199905061426.KAA28169@InterJet.chandlerevans.com> |
From: | "Roger L Gates" <rgates AT chandlerevans DOT com> |
To: | cygwin AT sourceware DOT cygnus DOT com |
Date: | Thu, 6 May 1999 10:22:31 -0400 |
MIME-Version: | 1.0 |
Subject: | EGCS bug when passing float NaN? |
X-mailer: | Pegasus Mail for Win32 (v3.01d) |
The attached code gave different results than I expected using CYGWIN B20.1 (gcc --version == egcs-2.91.57): global: NaN = 7f99999a passed: NaN = 7fd9999a The bit pattern is different inside the subroutine! I got similar results compiling with -mno-cygwin: global: 1.#QNAN0 = 7f99999a passed: 1.#QNAN0 = 7fd9999a Shouldn't the two values be the same? Is this a bug in egcs or is it in my code? Using DJGPP v2.02 (gcc --version == 2.8.1) the passed value equalled the global value. - Roger L. Gates <rgates AT chandlerevans DOT com> #include <stdio.h> union Converter { long l; float f; }; union Converter global; void pass_float(float f) { union Converter passed; passed.f = f; (void) printf("global: %f = %lx\n", global.f, global.l); (void) printf("passed: %f = %lx\n", passed.f, passed.l); } int main(void) { global.l=0x7F99999A; /* IEEE NaN */ pass_float(global.f); return 0; } -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |