This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/38704] New: Very bad quality of compilation of a floating point numbers.
- From: "lisp2d at lisp2d dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 Jan 2009 15:37:08 -0000
- Subject: [Bug c/38704] New: Very bad quality of compilation of a floating point numbers.
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
#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