bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bc: Accuracy bug?


From: Rogier Wolff
Subject: Re: bc: Accuracy bug?
Date: Sun, 15 Apr 2001 20:35:05 +0200 (MEST)

Andreas Schwab wrote:
[Charset iso-8859-1 unsupported, filtering to ASCII...]
> address@hidden (Rogier Wolff) writes:
> 
> |> Hi,
> |> 
> |> /home/wolff> bc -l
> |> bc 1.03 (Nov 2, 1994)
> 
> I'd suggest that you try out the lastest version (1.06).

Woops, I hadn't noticed an old version in /usr/local/bin. 

Same problem:

/home/wolff> bc
bc 1.06
Copyright 1991-1994, 1997, 1998, 2000 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'. 
ibase=16
obase=10
.55555555555*C
3.FFFFFFFFD4
.55555555556*C
3.FFFFFFFFD4
.5555555566*C
3.FFFFFFFE4
.55555555666*C
4.0000000057

The accuracy of the inputs is somehow mis-calculated, leading to
insufficient accuracy: Expected behaviour is that incrementing the
last digit in a repeating fraction leads to the multiplication result
going over the theoretical value. A few bits of lost accuracy is
acceptable: you might have to increment the last digit by two or three
to achieve a result above the theoretical one. However here we see
almost two whole 4-bit digits that can get lost!

                        Roger. 

-- 
** address@hidden ** http://www.BitWizard.nl/ ** +31-15-2137555 **
*-- BitWizard writes Linux device drivers for any device you may have! --*
* There are old pilots, and there are bold pilots. 
* There are also old, bald pilots. 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]