Boost logo

Boost :

From: Steven Watanabe (steven_at_[hidden])
Date: 2007-02-12 15:03:38


AMDG

Unless some precision benefit accrues from
multiplying the factors for each dimension
individually, it would be better to compute
the complete factor for the conversion once

    static
    quantity<unit<System2,Dim1>,Y>
    convert(const quantity<unit<System1,Dim1>,Y>& source)
    {
        Y val = source.value();
        static Y fac(compute_factor());
        val *= fac;
        return quantity<unit<System2,Dim1>,Y>::from_value(val);
    }

In Christ,
Steven Watanabe


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk