Boost logo

Boost :

From: Anatoli Tubman (anatoli_at_[hidden])
Date: 2001-09-01 06:19:31


On Friday 31 August 2001 02:45, Ken Shaw wrote:
> I feel that
> pounds <--> newtons
> slugs <--> kilograms
> should both be allowed, but
> pounds <--> kilograms
> should not, unless perhaps with a real_ugly_cast.
>
> But is it worth complicating the library with such a cast?
> What would it look like? (I assume it would never permit
> converting parsecs <--> volts.)

No, such cast should not be provided. Provide pound-mass
instead. (A mass of one pound-mass weighs one pound at
nominal Earth gravity.)

By the way, the "units" Unix program tells me that pound (lb) is
mass, and pound-force (lbf) is weight. I guess there's no
one true definition of pound.

> Are there other pairs of units that people might think are
> equivalent (modulo a location-scale transform) but which
> actually are not--or are these the only strange cases?

Kilogram and kilogram-force? Hm, I guess it's the same old
misnomer.

> I haven't looked at the quantity library in a while, but
> perhaps there's a way to specialize the error message in
> this case:
> Attempt to convert [e.g.] pounds (a unit of weight) to
> kilograms (a unit of mass). Convert to newtons and divide
> by the appropriate gravitational constant instead--G at
> sea level on Earth, for example.

That would be nice.

-- 
anatoli at ptc dot com -- opinions are mine

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