AMDG On 04/24/2013 07:08 AM, Olaf Peter wrote:
maybe I misuse it? Expect the compile errors I get
$ ./units 1000000000 q 0 m
- Don't use integer conversion factors. The library assumes that it can use constructs like x * (1/factor). You don't gain any precision by using int. Anything that can be represented in an int32_t can be represented exactly in a double. - You need to use bu::make_system/bu::unit for millimeter_base_unit, just like for meter_base_unit. - You can define multiple conversion factors. Just add BOOST_UNITS_DEFINE_CONVERSION_FACTOR( clients::units::my::length_base_unit, boost::units::si::meter_base_unit, double, 1000000000); to enable conversion to and from the Boost.Units systems. In Christ, Steven Watanabe