Ejemplo n.º 1
0
quantity<typename boost::ratio_add<R1, R3>::type, typename boost::ratio_add<R2, R4>::type>
operator*(const quantity<R1, R2>& x, const quantity<R3, R4>& y)
{
    typedef quantity<typename boost::ratio_add<R1, R3>::type, typename boost::ratio_add<R2, R4>::type> R;
    R r;
    r.set(x.get() * y.get());
    return r;
}
Ejemplo n.º 2
0
quantity<R1, R2>
operator-(const quantity<R1, R2>& x, const quantity<R1, R2>& y)
{
    typedef quantity<R1, R2> R;
    R r;
    r.set(x.get() - y.get());
    return r;
}
Ejemplo n.º 3
0
std::string to_magnitude( quantity< Dims, T > const & q )
{
    std::ostringstream os;
    os << q.get( detail::permit<T>() );
    return os.str();
}