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

List:       kde-devel
Subject:    Re: Open Bugs in 3.2
From:       Graeme Ambler <Graeme.Ambler () bristol ! ac ! uk>
Date:       2004-01-11 22:59:15
Message-ID: 200401112300.58636.Graeme.Ambler () bristol ! ac ! uk
[Download RAW message or body]

On Sunday 11 January 2004 20:06, Michael Pyne wrote:
> On Sunday 11 January 2004 09:24, Nicolas Goutte wrote:
> > That is how the FPU (floating point unit) works.
> >
> > Double has a certain number of significant bits, which makes it 15
> > significant decimal digits (before and after decimal point.) As pointed
> > out, the error is beyond that precision and therefore correct. The number
> > *is* correct at the given precision.
>
> Although technically true, even single precision is able to normally give
> four significant digits.  The problem isn't the fact that the answer is or
> is not correct, the problem is that the extra 1e-14 or so came from
> somewhere, and that somewhere wasn't from the user input.  Although we can
> blame it on decimal to binary conversion error, that excuse doesn't really
> fly if you ask me, since kcalc for 3.1.4 was able to successfully execute
> that input without the extra one.

You are missing the point.  The problem is that 16 significant figures were 
requested, not 4.  I also find it really hard to believe that the problem did 
not exist in 3.1.4.  Either kcalc in 3.1.4 was not outputting 16 significant 
figures or something VERY screwy is going on.  Try compiling and running the 
following (C) code:

#include <stdio.h>
int main()
{
  long double a=49.84;
  long double b=33.52;
  long double c=a+b;
  printf("%2.2llf + %2.2llf = %2.14llf\n",a,b,c);
}

You should once more get the "mysterious"
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

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