Bug 210484 - dc doesn't enforce precision consistently (sometimes)
dc doesn't enforce precision consistently (sometimes)
Product: Fedora
Classification: Fedora
Component: bc (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Zdenek Prikryl
Depends On:
  Show dependency treegraph
Reported: 2006-10-12 10:46 EDT by JW
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-07-26 04:33:28 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description JW 2006-10-12 10:46:35 EDT
Description of problem:
dc doesn't enforce precision.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1.echo "k 0 1 2 / p" | dc
2.echo "k 0 1 0.4 * p" | dc
Actual results:
1. "0"
2. ".4"

Expected results:
1. "0"
2. "0"

Additional info:
If precision setting is meaningless (as it appears to be in case of
multiplication) then a command should be available to actually enforce the
desired precision.
Comment 1 Zdenek Prikryl 2007-07-26 04:33:28 EDT
FC5 has now been EOL'd.

This is not a bug but a feature. Work with precisions is described at
http://www.gnu.org/software/bc/manual/dc-1.05/html_mono/dc.html. Operation "/"
takes care about precision value which is set by "k". Others operations (like
"*") calculates precision from operands (sometimes co-operates with precision

As I see in source code, precisions are calculated exactly as is described in
doc above.


Note You need to log in before you can comment on or make changes to this bug.