Re: bug in functions 'roundup' and 'ceil'
- From: Kjetil Torgrim Homme <kjetilho ifi uio no>
- To: Morten Welinder <terra diku dk>
- Cc: ain riiska ee, gnumeric-list gnome org
- Subject: Re: bug in functions 'roundup' and 'ceil'
- Date: 13 Aug 2001 23:30:18 +0200
[Morten Welinder]
I have attempted to "fix" this in current cvs sources. The real
problem is lack of understanding of binary math, but I guess we
cannot expect to pass that message to end users.
Therefore the "fix" is to be wrong on different numbers that most
users are not likely to stumble upon.
Isn't the right fix to run ceil(x) and ceil(x-epsilon), where epsilon
is the smallest possible difference to x (x/2**52 for doubles), and
return the value closest to x?
Kjetil T.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]