Boost logo

Boost Users :

Subject: Re: [Boost-users] [units] conversion_factor in the two directions
From: alfC (alfredo.correa_at_[hidden])
Date: 2010-02-28 00:41:34


> What you're missing is the conversion from
> s to m kg^-1 Eh^-1/2.  (I think the conversion
> factor should be sqrt(4.359744e-18))

you probably mean
s to m kg^1/2 Eh^-1/2
and yes that is the conversion factor.

Now, I have no idea what would be the syntax to transform from second
to something with combined units

BOOST_UNITS_DEFINE_CONVERSION_FACTOR(
       si::second,
       ???,
       double, sqrt(4.359744e-18)
);

> You could also make it work by adding
> BOOST_UNITS_DEFAULT_CONVERSION(
>     atomic::hartree_energy_base_unit,
>     si::energy
> );
>

that worked right away. What would be the drawback of using
DEFAULT_CONVERSION macro? loss of precision perhaps?

Thank you,
Alfredo


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net