Boost logo

Boost :

From: Eric Ford (eford_at_[hidden])
Date: 2001-10-02 20:44:49

> > For example, in the cgs system widely used for electromagnetic
> > calculations, electric charge has dimensions of length^(3/2) *
> > mass^(1/2) / time^2.
> Out of curiousity, does SIunits provide its own pow() function? Or
> does it only provide sqrt()? I've never understood how one would
> static units and still support a pow() function.

I don't think I understand your question, but I'll answer a related
one. :) At run time there is no (or at least very little) additional
code from SI units. There's no extra byte holding information about
each values units. So it just calls the normal pow, sqrt, or
whatever. All the checking is done at compile time. So when you
compile code to raise a value to a power, it does computer the
dimensions of the result to make sure that the resuling assignment is
valid. Since that needs to be done a compile time, it does have it's
own code to compute powers of dimensions.

> I've been spending the past three weeks teaching transformations in
> statistics. So we have been using a lot of things like Y^(1/4),
> log(Y) and other "power" transformations. So I'm not entirely
> unsympthetic to fractional units. BTW, what are the units of a
> log(dollars)?

log(dollars) is non-sensical. What you probably are thinking of is
log(some number of dollars/ dollars) which is the log of a
dimensionless number which is also dimensionless.

You might want to read through some of the older posts on the matter
of dimensions and units. Or maybe someone knows of a website with a
good discussion?

