Bug 171088 - Units doesn't correctly convert (x)bytes into (y)bytes.
Summary: Units doesn't correctly convert (x)bytes into (y)bytes.
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: units
Version: 4
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Harald Hoyer
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-10-18 02:18 UTC by Ian
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-10-18 07:39:41 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Ian 2005-10-18 02:18:11 UTC
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 07:39:41 UTC
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 07:43:11 UTC
$ 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.