Boost logo

Boost Users :

Subject: Re: [Boost-users] [units] Conversions from quantities
From: Michael Powell (mwpowellhtx_at_[hidden])
Date: 2015-08-13 15:20:47

On Thu, Aug 13, 2015 at 3:14 PM, Steven Watanabe <watanabesj_at_[hidden]> wrote:
> On 08/12/2015 04:39 PM, Michael Powell wrote:
>> Just wanted to clarify something. These should convert from given
>> quantities to the desired units?
> If what you really want is a raw double,
> than, yes, this should work.
>> double
>> unit_conversion::from_length_to_inches(quantity<length> const & L) {
>> const quantity<inch_base_unit::unit_type> result_(L);
>> return result_.value();
>> }
>> double unit_conversion::from_mass_to_pounds(quantity<mass>
>> const & M) {
> Pounds is a unit of force, not mass. To do
> such a conversion, you need to multiply by g.

Pound-force (literally, "lbf") or pounds (i.e. "lb")? Interestingly
enough, I may also need to work in Pound-force, or a neighboring unit,
i.e. "slugs.ft/s"

Would you mind disambiguating that in terms of Boost.Units? As far as
I can tell from the US base unit
in this instance.

Thank you...

>> const quantity<ounce_base_unit::unit_type> result_(M);
>> return result_.value();
>> }
> In Christ,

BTW, did you find the PR okay for next version(s) of Units and/or Boost?

> Steven Watanabe

In Him.

> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at