Boost logo

Boost :

From: Dan W. (danw_at_[hidden])
Date: 2004-01-05 05:06:44


Andy Little wrote:
>>Standard measure of noise in operational amplifiers:
>>Current noise: nA/(Hz^(0.5)) //"nano-Amps per root-Hertz"
>>Voltage noise: mV/(Hz^(0.5)) //...
> Thankyou Dan .... ACCEPTED :-)
> What am I going to do about it .... dont know yet :-)

Start again. You'll get the right thing done in a snap, now. ;-)

Simplest solution that could possibly work, but no simpler than the
simplest solution to *use*:

using boost::unit_system::dimensions;

dim length;
dim time;
dim speed;
dim hertz;
dim root_hertz;
dim freckles;
rel speed<length over time>;
rel root_hertz<hertz^(1/2)>;

using boost::unit_system::units;

unit length<meters,"m">; //or meters<length,"m">, whatever
unit time<seconds,"s">;
unit speed<meters_per_second,"m/s">
rel meters_per_second< meters / seconds, 1.0>; //overload /
rel meters< meters_per_second * seconds, 1.0>; //overload *
rel seconds< meters / meters_per_second, 1.0>; //overload /
//if indeed it's possible to overload * and / for metaprog

using boost::numeric; //or whatever it's called

measure<meters,float32> braking_distance;
measure<freckles,fractional> tatoo_exceptions;

//and so on...

Later come up with SI definitions, like an installable font.

Cheers!


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