public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/50695] New: double comparison broken after computation
@ 2011-10-11  2:24 gpib at rickyrockrat dot net
  2011-10-11  8:54 ` [Bug c/50695] " rguenth at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: gpib at rickyrockrat dot net @ 2011-10-11  2:24 UTC (permalink / raw)
  To: gcc-bugs

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)


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2011-10-12 17:40 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-11  2:24 [Bug c/50695] New: double comparison broken after computation gpib at rickyrockrat dot net
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

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).