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
* [Bug c/38704] Very bad quality of compilation of a floating point numbers.
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 ` schwab at suse dot de
2009-01-02 19:38 ` lisp2d at lisp2d dot net
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: schwab at suse dot de @ 2009-01-02 17:03 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from schwab at suse dot de 2009-01-02 17:02 -------
Depending on the actual value of DECIMAL_DIG this does not really look bad.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38704
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c/38704] Very bad quality of compilation of a floating point numbers.
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
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: lisp2d at lisp2d dot net @ 2009-01-02 19:38 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from lisp2d at lisp2d dot net 2009-01-02 19:37 -------
Quantity of correct bits is 64, the size of long double is 128 bits.
Half of quality is reached by usage of operations multiplication, divisions.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38704
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c/38704] Very bad quality of compilation of a floating point numbers.
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
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: kargl at gcc dot gnu dot org @ 2009-01-02 20:16 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from kargl at gcc dot gnu dot org 2009-01-02 20:14 -------
(In reply to comment #2)
> Quantity of correct bits is 64, the size of long double is 128 bits.
>
> Half of quality is reached by usage of operations multiplication, divisions.
>
What does 'grep LDBL /usr/include/float.h' show?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38704
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c/38704] Very bad quality of compilation of a floating point numbers.
2009-01-02 15:38 [Bug c/38704] New: Very bad quality of compilation of a floating point numbers lisp2d at lisp2d dot net
` (2 preceding siblings ...)
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
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: lisp2d at lisp2d dot net @ 2009-01-03 0:14 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from lisp2d at lisp2d dot net 2009-01-03 00:12 -------
__LDBL_DIG__=18
__DBL_DIG__=15
sizeof(long double)=128 bits
sizeof(double)=64 bits
It is named the legalised crime.
If the program is written incorrectly no law will correct it.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38704
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c/38704] Very bad quality of compilation of a floating point numbers.
2009-01-02 15:38 [Bug c/38704] New: Very bad quality of compilation of a floating point numbers lisp2d at lisp2d dot net
` (3 preceding siblings ...)
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
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-01-03 0:18 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from pinskia at gcc dot gnu dot org 2009-01-03 00:17 -------
What target is this on?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38704
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c/38704] Very bad quality of compilation of a floating point numbers.
2009-01-02 15:38 [Bug c/38704] New: Very bad quality of compilation of a floating point numbers lisp2d at lisp2d dot net
` (4 preceding siblings ...)
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
7 siblings, 0 replies; 9+ messages in thread
From: kargl at gcc dot gnu dot org @ 2009-01-03 0:43 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from kargl at gcc dot gnu dot org 2009-01-03 00:42 -------
(In reply to comment #4)
> __LDBL_DIG__=18
> __DBL_DIG__=15
>
> sizeof(long double)=128 bits
> sizeof(double)=64 bits
>
You didn't show what I requested. The other piece
of the puzzle is LDBL_MANT_DIG, which I'll wager is
64. I suspect that you may be misinterpreting what
sizeof() is telling you.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38704
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c/38704] Very bad quality of compilation of a floating point numbers.
2009-01-02 15:38 [Bug c/38704] New: Very bad quality of compilation of a floating point numbers lisp2d at lisp2d dot net
` (5 preceding siblings ...)
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
7 siblings, 0 replies; 9+ messages in thread
From: lisp2d at lisp2d dot net @ 2009-01-03 17:21 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from lisp2d at lisp2d dot net 2009-01-03 17:19 -------
The type long double does not have uniform standard.
Confusion has turned out.
Accuracy of type double suits me.
Let's complete this talk.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38704
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug c/38704] Very bad quality of compilation of a floating point numbers.
2009-01-02 15:38 [Bug c/38704] New: Very bad quality of compilation of a floating point numbers lisp2d at lisp2d dot net
` (6 preceding siblings ...)
2009-01-03 17:21 ` lisp2d at lisp2d dot net
@ 2009-01-09 9:09 ` schwab at suse dot de
7 siblings, 0 replies; 9+ messages in thread
From: schwab at suse dot de @ 2009-01-09 9:09 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from schwab at suse dot de 2009-01-09 09:09 -------
Not a bug.
--
schwab at suse dot de changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
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).