Whats the range of dimension exponents in the SI system of units? I am working on a software library for Units of Measure. To represent dimensions, I need to know the required range of exponents for each of the seven base units (precisely, I need to know the required maximum number of bits for each exponent). After reading many related questions, I still have some questions.
As far as I understand, all physical quantities can be expressed as the product of the seven base units, with each base unit raised to the power of $0$, $\pm1$, $\pm2$, $\pm3$, and so on. So the dimension of a quantity is represented by a vector / array of 7 integers.
E.g. for volume (length ^ 3) that array would be (3, 0, 0, 0, 0, 0, 0), for acceleration (length / (time ^ 2)) it would be (1, -2, 0, 0, 0, 0, 0).
While I could calculate the square of a volume (with dimension 6,0,0,..), it doesn't make much sense, because I have never encountered any physical quantity that needs (length ^ 6).
My questions:

*

*a) What is the maximum required exponent for Length? Do you know any example where $\pm3$ is not enough?


*b) Maximum exponent for Time? Any example beyond $\pm4$?
(update: raised to 4 for capacitance)


*c) Maximum exponent for Mass? Any example beyond $\pm1$?


*d) Maximum exponent for Electric Current? Any example beyond $\pm1$?


*e) Maximum exponent for Temperature? Any example beyond $\pm4$?
(update: raised to 4 for Stefan-Boltzmann constant)


*f) Maximum exponent for Amount of Substance? Any example beyond $\pm1$?


*g) Maximum exponent for Luminous Intensity? Any example beyond $\pm1$?
... plus three bonus questions:

*

*h) Is there some required order of the seven base units? I have seen more than one ordering in use.


*i) Are those seven base units enough for everything, or is there some bleeding-edge science that needs more?


*j) Are the exponents always integral? Never ever something like ^ 1.5 or ^e?
(update)
I guess I should clarify:
I am aware that values might need rational or real exponents.
I am aware that intermediate results might need a wider range of integer exponents.
I have read the relevant SI standard document, and lots of websites about the topic.
My questions are just about the base units exponents that define the dimension of (base or derived) units.
The most precise statement I found so far was: the exponents are very small integers.
However, to exploit all filthy speed tricks of CPU or GPU assembly programming, I need to know the exact number of bits required.
 A: At least one common quantity I can think of has dimension with a non-integer exponent. The specific detectivity, $\text{D}^*$ is a common descriptor of photodiodes, and I'm sure one could make an analogous figure of merit for other types of sensor.
The unit of $\text{D}^*$ is the "Jones," which is equal to
$$\frac{cm \cdot \sqrt{Hz}}{W}$$
Watts in SI decompose into
$$Kg \cdot m^2 \cdot s^{-3}$$
which makes one Jones equal to:
$$\frac{s^{2.5}}{Kg \cdot m} \times 10^{-2}$$
with dimension:
$$\text{time}^{2.5} \text{mass}^{-1} \text{length}^{-1}$$
There are other quantities related to $\text{D}^*$, such as Noise Equivalent Power (NEP), which come up a lot in radiometry. Basically, any measurement which is normalized by frequency bandwidth will end up with that $\sqrt{Hz}$ in the units.
A: Regardless of whether you really need it, here's what I have found to be usable:
As I said, I represent all units internally as cgs:
$$
  \mathrm{U} = \mathrm{cm}^c\cdot \mathrm{g}^g\cdot\mathrm{s}^s
$$
Where, in general, $c,g,s\in\mathbb{Q}$.
For this, I have 3 ints, defined by
$$
  i_c = 39916800 \cdot c
$$
etc., so that, $39916800$ being $11!$, I can be almost completely sure that nobody will ever come up with a unit such that $i_c\not\in\mathbb{Z}$. It also supports exponents up to $\frac{2^{31}}{11!}\approx 53$, which I'm quite sure should be enough.
You may argue that using full integer variables is a great waste of resources, but I actually think (haven't tried it, though) that it's faster than a naïvely implemented array of chars, because the processor does not even directly calculate those, if you ask it to: it first needs to cast them to int, do the calculation there, and cast them back to char.
And as I said, you probably don't need to worry at all about performance if you do the unit stuff at compile time. The quantities do not need any knowledge about their SI exponentials whatsoever then, and if you need some way to uniquely identify units, you can just put all the units that actually occur during the preprocessing in a hash map or something and let the calculable quantities store only pointers to the unit objects.
A: The range for the exponents you need is (- infinity , + infinity). Units for school physics will mostly use signed integer in the range of [-3,+3] but in thermodynamics and quantum mechanics one may look at many dimensions. 
Perhaps you can find some ideas how others solved the problem in units. http://linux.die.net/man/1/units
Keep in mind, that some values might be tensors or vectors.
A: I don't think you can just use integers in all cases.  For example the statcoulomb, the gaussian unit of charge, is defined as
$1 \text{ statcoulomb} = \frac{g^{1/2} cm^{3/2}} {s}$.
Also,the Stefan-Boltzmann constant's units are proportional to $T^{-4}$. Specifically, from Wikipedia:
$$\sigma = 5.670400 \times 10^{-8}J s^{-1}m^{-2}K^{-4}$$
A: In a paper, dated yesterday, where units are studied I can see wavelength raised to -5 , temperature raised to 4.
I do not know the actual maximum exponents in all circumstances.  
Constant or Quantity --- Dimension 
Planck Constant h  --- $ML^{2}T^{-1}$
Stefan Constant $\sigma$ ---  $MT^{-3}\theta^{-4}$
Boltzmann Constant k --- $ML^{2}T^{-2}\theta^{-1}$
Temperature $\theta$  --- $\theta$
Energy  --- $ML^{2}T^{-2}$
Force  ---  $MLT^{-2}$
Pressure  --- $ML^{-1}T^{-2}$
Luminosity --- $MT^{-3}$
Power  --- $ML^{2}T^{-3}$
Velocity  --- $LT^{-1}$
Electron charge  --- $Q$
Proton mass ---  $M$
Bohr radius  --- $L$   
A: I am also working on the development of a namespace for quantities and units and I stumbled upon this old discussion.
My small and late contribution:
a)-g) The exponent for length can be as high as six (dipole-dipole interaction, such as in Fluorescence Resonance Energy Transfer). The exponent for current / charge can be +-2 (capacitance, resistance, permittivity, permeability, Coulomb constant) and I guess the same can happen to Mass. In Chemistry, the thermodynamic equilibrium constant has dimensions equal to a power of the pressure, or of the molar concentration, with an exponent equal to the difference in the stoichiometric coefficient, which is limited by the reaction order. For a single reaction, the maximum reaction order observed is 6 (https://www.quora.com/What-is-the-maximum-order-of-reaction; http://pubs.acs.org/doi/abs/10.1021/ja01304a016); for a reaction chain, it can be unlimited (think about polymers...)
h) I think the crystallised order is L M T I Θ N J with exponents 
i) Maybe also units for angles and logarithmic units (bel, nit, digit, bit) could be included, but I am in doubt.
j) I never saw exponents other than integers and half-integers (square roots) but maybe they occur in mixed-order chemical reactions.
A: (Perhaps OP should have posted separate questions back in the day, but here we are.)

i) Are those seven base units enough for everything, or is there some bleeding edge science that needs more ?

No, the seven base units are not enough for everything.  But there doesn't need to be any bleeding-edge science involved.  One of the base units, the mole, isn't actually a unit of the quantity it measures -- "amount of substance".
A table in the Wikipedia article on SI describing base quantities has the most recent definition of the mole from the relevant SI document:

The amount of substance of exactly $6.02214076×10^{23}$ elementary entities3.

But there's a footnote:



*When the mole is used, the elementary entities must be specified and may be atoms, molecules, ions, electrons, other particles, or specified groups of such particles.


The mole is more of a schema for creating units than an actual unit. You never just have a "mole", you have to have a mole of something specific.
Avogadro's constant is just a count.   Unless you specify the type of elementary entity you're counting (and only one of the types useful in chemistry) it doesn't give rise to a useful "amount of substance".  So technically, there's a different base quantity for every type of elementary entity being measured.
There are plenty of other things that are counted in science, but since they're not used in chemistry or physics, they never got baked into SI.  And you can't measure them in moles, except whimsically.
There's an analogy in axiomatic set theory: Two of the Zermelo-Frankel "axioms" aren't really axioms at all.  They're axiom schemata, and generate a different axiom for each property under consideration.
