public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "gpib at rickyrockrat dot net" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c/50695] New: double comparison broken after computation Date: Tue, 11 Oct 2011 02:24:00 -0000 [thread overview] Message-ID: <bug-50695-4@http.gcc.gnu.org/bugzilla/> (raw) http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50695 Bug #: 50695 Summary: double comparison broken after computation Classification: Unclassified Product: gcc Version: 4.4.3 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassigned@gcc.gnu.org ReportedBy: gpib@rickyrockrat.net 1e-6*1e6 != 1 The following minimal code segment fails (compile with gcc -o x x.c): #include <string.h> int main(int argc, char *argv){ double x,y; x=strtof(",+1.00000E-06,",NULL); y=1000; y*=1000; if(x*y!=1) printf("Bug!!\n"); else printf("Nobug\n"); } gcc -v Using built-in specs. Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.4.3-4ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --program-suffix=-4.4 --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-plugin --enable-objc-gc --disable-werror --with-arch-32=i486 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5) Also fails with: Using built-in specs. Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.4.3-4ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --program-suffix=-4.4 --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-plugin --enable-objc-gc --disable-werror --with-arch-32=i486 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5)
next reply other threads:[~2011-10-11 2:24 UTC|newest] Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top 2011-10-11 2:24 gpib at rickyrockrat dot net [this message] 2011-10-11 8:54 ` [Bug c/50695] " rguenth at gcc dot gnu.org 2011-10-11 8:59 ` rguenth at gcc dot gnu.org 2011-10-11 9:11 ` schwab@linux-m68k.org 2011-10-11 12:24 ` marc.glisse at normalesup dot org 2011-10-11 19:05 ` gpib at rickyrockrat dot net 2011-10-11 19:06 ` gpib at rickyrockrat dot net 2011-10-11 19:25 ` gpib at rickyrockrat dot net 2011-10-11 19:34 ` gpib at rickyrockrat dot net 2011-10-11 19:39 ` gpib at rickyrockrat dot net 2011-10-12 11:35 ` rguenth at gcc dot gnu.org 2011-10-12 17:40 ` gpib at rickyrockrat dot net
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-50695-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).