[units] inconvent printing of composite scaled units

great, it works, using the CGS example, if I define:
namespace boost{namespace unit{ namespace si{ typedef scaled_base_unit<boost::units::si::second_base_unit, scale<10, static_rational<-15> > > femtosecond_base_unit; typedef femtosecond_base_unit::unit_type femtosecond_unit; static const femtosecond_unit femtosecond, femtoseconds; } }}
then
cout << 3.*si::meter/si::femtosecond << endl; // prints 3 m fs^-1
while
cout << 3.*si::meter/(si::femto*si::second) << endl; //print 3 P(m s^-1), notice the ugly P (for Peta)
this gives better control on the intended output (at least).
(Unfortunately this operation doesn't work 3.*si::femtosecond + 2.*(si::femto*si::second) )
I'm guessing that this is an issue of mixing scaled and unscaled quantities... It should probably work, though, since si::femto*si::second should really return the scaled unit you define manually above. I'll look into it, though it may be a while. Matthias
participants (1)
-
Matthias Schabel