Boost logo

Boost :

From: Dean Foster (foster_at_[hidden])
Date: 2001-09-14 16:04:49


> From: "George A. Heintzelman" <georgeh_at_[hidden]>
>
> > but why would you want two fuctions:
> >
> > kg/m^3 density(kg m, m r)
> > kg/cm^3 density(kg m, cm r)
>
> Sure, I can come up with an example. Suppose you want to know how much
> energy is being delivered by a particle accelerator. You're a doctor
> calculating a dose for a patient, so you want the energy either in ergs
> or calories (I'm not really sure what doctors will use, but it's not
> electron volts). On the other hand, the energy of the beam is typically
> measured with two quantities: first, the energy of a given particle, in
> some electron-volt scale, and the luminosity of the beam, in units
> which can be converted to particles per second (luminosity is more
> complicated than this, but let me finesse this for purposes of the
> example). Your calculation will be something like:
>
> energy/particle * particles/second * seconds of exposure
>
> but you will want to implicitly convert from MeV/second to ergs/second.
>

But why wouldn't this all be handled at the user interface level?
Once we are in the actual code wouldn't the function look just as you
describe.

         energy/particle * particles/second * seconds of exposure

There is no mention of anything to do with calories, ergs, etc in this
equation.

So my claim is the following. We have 3 people working on a system: a
physisist, a doctor, and a user. The physisist writes some code. The
doctor writes some code. The user runs the code. None of the
functions written by either the physisists code or the doctors would
mention electron volts or ergs or calories. Only when the user types
in some inputs would actual electron volts be mentioned, or when the
program prints out results might calories be mentioned. Why would
these ever be used explicitely in the code of the physisist or the
doctor themselves? This is the question I don't understand.

            ---------- tirade about size --------

Sorry about the following tirade. Given this friendly discussion on
this news group I feel very out of place doing it. So I suggest
simply skipping the following--but like most flamage, I will feel
better having written it. :-)

The issues of representing small and big numbers seems somewhat of a
non-issue. Don't most compliers represent doubles with a range of
about 10^-300 to 10^300? Given the largest SI units divided by the
smallest SI unit of any measurement is probably much less than 10^50.
For example switching from nano-meters to light-years is only 10^25.
So this simply shifts the range of 10^-300 to 10^300 to 10^-275 to
10^325. Given the volumn of the universe in terms of Plank(sp)
distances is well under 10^300 this savings doesn't seem like much.
If this is a real problem shouldn't the user just template over some
sort of "long double" rather than using a double in the first place?
(On g++ that gives you to 10^4932. If we start using number bigger
than that, we are definitely no longer talking about physical
quantities!)

                  ---------- end tirade --------

later,

dean

=============================================================================
Dean Foster dean_at_[hidden]
Statistics, Wharton, U. Penn 215 898 8233
Philadelphia PA 19104-6302 http://diskworld.wharton.upenn.edu


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk