Opened 6 years ago
Closed 6 years ago
#12429 closed Bugs (fixed)
CGS unit of current is not well defined in reference ot Ampere
Reported by: | Owned by: | Matthias Schabel | |
---|---|---|---|
Milestone: | To Be Determined | Component: | units |
Version: | Boost 1.61.0 | Severity: | Showstopper |
Keywords: | Cc: |
Description
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> > >
Note:
See TracTickets
for help on using tickets.
Merged PR https://github.com/boostorg/units/pull/23 to develop and to master this week