Re: [Boost-bugs] [Boost C++ Libraries] #4418: units::electron_charge units::current incorrect

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #4418: units::electron_charge units::current incorrect
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-07-11 00:00:28


#4418: units::electron_charge units::current incorrect
-------------------------------------------+--------------------------------
  Reporter: mejames7760.atatatat.att.net | Owner: matthiasschabel
      Type: Bugs | Status: new
 Milestone: Boost 1.44.0 | Component: units
   Version: Boost 1.40.0 | Severity: Problem
Resolution: | Keywords: units charge current
-------------------------------------------+--------------------------------

Comment (by steven_watanabe):

 First of all, the dimensions chosen as base dimensions don't matter except
 when you want to use make_dimension_list directly. The only thing that
 matters is the relationships between dimensions.

 The commented out code is wrong because it treats current as though it
 were electric charge. The correct definition is

 {{{
 typedef make_dimension_list<
     boost::mpl::list< dim< length_base_dimension,static_rational<3> >,
                       dim< mass_base_dimension,static_rational<1> >,
                       dim< time_base_dimension,static_rational<-4> >,
                       dim< current_base_dimension,static_rational<-2> > >
>::type coulomb_constant_dimension;
 }}}

 an alternate definition which is somewhat easier to understand is

 {{{
 typedef mpl::times<
     force_dimension,
     static_power<length_dimension, static_rational<2> >::type,
     static_power<electric_charge_dimension, static_rational<-2> >::type
>::type coulomb_constant_dimension;
 }}}

 P.S. all I needed to see was main.cpp, which easily fits within trac's
 limits.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/4418#comment:5>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:03 UTC