Subject: [Boost-bugs] [Boost C++ Libraries] #12429: CGS unit of current is not well defined in reference ot Ampere
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-09-01 20:36:24
#12429: CGS unit of current is not well defined in reference ot Ampere
------------------------------+-----------------------------
Reporter: alfredo.correa@⦠| Owner: matthiasschabel
Type: Bugs | Status: new
Milestone: To Be Determined | Component: units
Version: Boost 1.61.0 | Severity: Showstopper
Keywords: |
------------------------------+-----------------------------
1 biot (cgs unit of current) is converted to 0.1 Ampere. It should be 10
Ampere.
{{{
#include <boost/units/systems/cgs/io.hpp>
#include <boost/units/systems/si/io.hpp>
#include <iostream>
using std::cout;
int main(){
using namespace boost::units;
cout << 1.*cgs::biot << " = " <<
quantity<si::current>(1.*cgs::biot) << '\n'; // not ok! "1 Bi = 0.1 A"
cout << 1.*cgs::centimeter << " = " <<
quantity<si::length>(1.*cgs::centimeter) << '\n';
cout << 1.*cgs::gram << " = " << quantity<si::mass>(1.*cgs::gram)
<< '\n';
}
}}}
The solution is change -1 by 1 in "boost/units/base_units/cgs/biot.hpp"
from
{{{
typedef scaled_base_unit<boost::units::si::ampere_base_unit, scale<10,
static_rational<-1> > >
}}}
to
{{{
typedef scaled_base_unit<boost::units::si::ampere_base_unit, scale<10,
static_rational<1> > >
}}}
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/12429> 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:20 UTC