[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    dump question
From:       Uwe Thiem <uwe () uwix ! alt ! na>
Date:       1999-08-08 12:06:43
[Download RAW message or body]

I'm stuck with a little problem I'm too dump to solve it seems. Maybe
someone else can shed some light on it.

This is the code:

double tmp = mRealCenter - mRealWidth / 2.0;

QString s;
s.setNum( tmp, 'f', 60 );
cerr << s << "\n";
for ( i = 0, p = mReals; i < 3; i++, p++ )
  {
  s.setNum( (double) i * mRealWidth / (double) mWidth, 'f', 60 );
  cerr << s << "\n";
  s.setNum( tmp + (double) i * mRealWidth / (double) mWidth, 'f', 60 );
  cerr << s << "\n";
  }
cerr << "\n";


And here comes the output:

0.291609459012032723457252814114326611161231994628906250000000
0.000000000000000000000000000000000000000000000000000000000000
0.291609459012032723457252814114326611161231994628906250000000
0.000000000000000000733384188652038425800936390023343002917542
0.291609459012032723457252814114326611161231994628906250000000
0.000000000000000001466768377304076851601872780046686005835084
0.291609459012032723457252814114326611161231994628906250000000

The first line represents the variable "tmp" in the code. Then follow
three pairs of lines. The first represents a small number
calculated in the code and the second the sum of "tmp" and this
small number. As you can see the small number is about 19 levels
of magnitude smaller than "tmp" but still significant. What baffles
me is that although the small numbers _are_ significant and 
different the sums are all equal.

Sure, if the small numbers get much smaller this problem will occur
eventually. But why so early? At this stage the sums should
differ but don't.    #-(

Uwe

-------------------------------------------------------------------------
Uwe Thiem                                        Tel: +264 - 061 - 244511
P.O.Box 30955                                    Fax: +264 - 061 - 244511
Windhoek                                         Email:   uwe@uwix.alt.na
Republic of Namibia                                           uwe@kde.org
                                                       http://www.kde.org
                  **********************************
         You can still escape from the GATES of hell: Use KDE!
-------------------------------------------------------------------------

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic