public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/38704]  New: Very bad quality of compilation of a floating point numbers.
@ 2009-01-02 15:38 lisp2d at lisp2d dot net
  2009-01-02 17:03 ` [Bug c/38704] " schwab at suse dot de
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: lisp2d at lisp2d dot net @ 2009-01-02 15:38 UTC (permalink / raw)
  To: gcc-bugs

#include        <iostream>
int     main(int,char**){
        const   long    double  PiLD=3.1415926535897932384626433832795029L;
        std::cout<<"   3.1415926535897932384626433832795029"<<std::endl;
        std::cout.precision(70);
        std::cout<<"LD="<<PiLD<<std::endl;
        return  0;}

/*

Very bad quality of compilation of a floating point numbers.

   3.1415926535897932384626433832795029
LD=3.14159265358979323851280895940618620443274267017841339111328125

Can be much more qualitative to calculate from other end.

#include        <cmath>
        for( ){
                if( odd(last digit) ){
                        last digit -=1;
                        x+=0.5;}
                x=std::ldexp(x,-1);
                manual division of string representation /=2;}
        result = x
*/


-- 
           Summary: Very bad quality of compilation of a floating point
                    numbers.
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: lisp2d at lisp2d dot net


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38704


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

end of thread, other threads:[~2009-01-09  9:09 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-02 15:38 [Bug c/38704] New: Very bad quality of compilation of a floating point numbers lisp2d at lisp2d dot net
2009-01-02 17:03 ` [Bug c/38704] " schwab at suse dot de
2009-01-02 19:38 ` lisp2d at lisp2d dot net
2009-01-02 20:16 ` kargl at gcc dot gnu dot org
2009-01-03  0:14 ` lisp2d at lisp2d dot net
2009-01-03  0:18 ` pinskia at gcc dot gnu dot org
2009-01-03  0:43 ` kargl at gcc dot gnu dot org
2009-01-03 17:21 ` lisp2d at lisp2d dot net
2009-01-09  9:09 ` schwab at suse dot de

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