strtonum(3) in FreeBSD?
Bakul Shah
bakul at BitBlocks.com
Sat Apr 16 12:42:43 PDT 2005
> > > > When talking about digital data storage K means times 2^10, M means
> > > > times 2^20, G means 2^30 and T means 2^40.
> > > >
> > > > 1K = 1 * 2^10 bytes = 1024 bytes
> > > > 1M = 1 * 2^20 bytes = 1048576 bytes
> > > > 1G = 1 * 2^30 bytes = 1073741824 bytes
> > >
> > > The disk drive manufacturers seem to disagree with you. For instance
> > > Seagate:
> > >
> > > http://www.seagate.com/products/discselect/glossary/index.html#cap
> > >
> > > "Most disc drive companies, including Seagate, calculate disc capacity
> > > based on the assumption that 1 megabyte = 1000 kilobytes and 1
> > > gigabyte=1000 megabytes."
> >
> > So their drives look bigger than they really are. Duh!
Disk vendors' use is actually what the SI (International
System of Units) people prefer. They want G<unit> to mean
10^9 <unit>s and *not* 2^30 <unit>s regardless of what is
being measured/counted.
> Whether you like it or not, this is pretty much the industry standard
> in the storage industry. Not much option but to get used to it..
Or we can all start using metric unit prefixes for decimal
and binary numbers and there'd be no ambiguity. Right now
even within the computer industry what a G means depends on
what is being measured and who is doing the measuring. The
IEC 27-2 and IEEE 1541-2002 binary prefixes are:
factor Symbol Name Origin
2^10 Ki kibi kilobinary
2^20 Mi mibi megabinary
2^30 Gi gibi gigabinary
2^40 Ti tebi terabinary
2^50 Pi pebi petabinary
2^60 Ei exbi exabinary
See http://physics.nist.gov/cuu/Units/binary.html
http://www.cofc.edu/~frysingj/binprefixes.html
http://www.cl.cam.ac.uk/~mgk25/metric-system-faq.txt
More information about the freebsd-current
mailing list