loss of precision (while calculating in hex).
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
bc (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: bc
Although bc has been working flawlessly for me for many years I
stumbled into an annoying loss-of-precision today.
This is good:
assurancetourix:~> bc -l
bc 1.06.94
Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'.
.126*3
.378
1.26*3
3.78
12.6*3
37.8
126.*3
378
This is bad:
assurancetourix:~> bc -l
bc 1.06.94
Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'.
ibase=16
obase=10
.126*3
.368
1.26*3
3.6B
12.6*3
36.E
126.*3
372
.126000*3.0000
.371FEEB2D
(for completeness...
By my own calculation in hex .126*3 = .372, while bc gives the wrong
answer: .368)
ProblemType: Bug
Architecture: i386
DistroRelease: Ubuntu 9.04
NonfreeKernelMo
Package: bc 1.06.94-3ubuntu1
ProcEnviron:
PATH=(custom, user)
LANG=en_US.UTF-8
SHELL=/bin/tcsh
SourcePackage: bc
Uname: Linux 2.6.28-17-generic i686
I couldn't find an upstream bug tracker, so I emailed this to <email address hidden> as well.