Bug 210484 - dc doesn't enforce precision consistently (sometimes)
Summary: dc doesn't enforce precision consistently (sometimes)
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: bc   
(Show other bugs)
Version: 5
Hardware: All Linux
medium
medium
Target Milestone: ---
Assignee: Zdenek Prikryl
QA Contact:
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-10-12 14:46 UTC by JW
Modified: 2007-11-30 22:11 UTC (History)
0 users

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


Attachments (Terms of Use)

Description JW 2006-10-12 14:46:35 UTC
Description of problem:
dc doesn't enforce precision.


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

How reproducible:
Always

Steps to Reproduce:
1.echo "k 0 1 2 / p" | dc
2.echo "k 0 1 0.4 * p" | dc
3.
  
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 08:33:28 UTC
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
value).

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

Zdenek.


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