Bug 171088 - Units doesn't correctly convert (x)bytes into (y)bytes.
Units doesn't correctly convert (x)bytes into (y)bytes.
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: units (Show other bugs)
4
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Harald Hoyer
Ben Levenson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-10-17 22:18 EDT by Ian
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:
Environment:
Last Closed: 2005-10-18 03:39:41 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Ian 2005-10-17 22:18:11 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050923 Fedora/1.7.12-1.5.1

Description of problem:
The units program doesn't correctly convert between bytes, kilobytes, megabytes, gigabytes, etc (or kilobits &c. for that matter.) Here's output from my units program.

2084 units, 71 prefixes, 32 nonlinear units

You have: 1024 kilobytes
You want: megabytes
        * 1.024
        / 0.9765625
You have: 5000 megabytes
You want: gigabytes
        * 5
        / 0.2
You have: 1024 kilobits
You want: megabits
        * 1.024
        / 0.9765625
You have: 5000 megabits
You want: gigabits
        * 5
        / 0.2



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

How reproducible:
Always

Steps to Reproduce:
1. start units
2. try converting bit/byte units

  

Actual Results:  It gives the wrong answer!

Expected Results:  It should give the right answer (sorry not a math person.)

Additional info:
Comment 1 Harald Hoyer 2005-10-18 03:39:41 EDT
kibi-                   2^10     # In response to the convention of illegally
mebi-                   2^20     # and confusingly using metric prefixes for
gibi-                   2^30     # powers of two, the International
tebi-                   2^40     # Electrotechnical Commission aproved these
pebi-                   2^50     # binary prefixes for use in 1998.  If you
exbi-                   2^60     # want to refer to "megabytes" using the
Ki-                     kibi     # binary definition, use these prefixes.


$ units
You have: 1024 kibits
You want: mebits
        * 1
        / 1
Comment 2 Harald Hoyer 2005-10-18 03:43:11 EDT
$ units
2438 units, 71 prefixes, 32 nonlinear units

You have: 5000 MiB
You want: GiB
        * 4.8828125
        / 0.2048
You have: 5000 MiB
You want: bits
        * 4.194304e+10
        / 2.3841858e-11

You have: 1 KiB
You want: bits
        * 8192
        / 0.00012207031


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