Thursday, July 06, 2006

Prefixes

When specifying the size of a device in bytes (for example) typically we see a number, we'll call it P here, and a symbol K, M, G or T (and there are more). The problem is that folks allow their definitions of the above symbols to vary.

The actual number of bytes (or whatever) will be represented by N.

Generally, all possible meanings can unfortunately be expressed by:

N = 103n 210m P

where n + m = k.

For the symbols, k has the following values.


K k = 1
M k = 2
G k = 3
T k = 4



Hopefully, n = 0 and m = k but, sadly, that frequently isn't the case.

I think the best and most unambiguous solution is n = m = k = 0 and N = P!