src/third_party/icu/source/i18n/units_converter.cpp
// Load Factor of a compound source unit.
Load Factor of a compound source unit.
Load Factor of a compound source unit .
Factor loadCompoundFactor(const MeasureUnitImpl &source, const ConversionRates &ratesInfo,
                          UErrorCode &status) {
    Factor result;
    for (int32_t i = 0, n = source.units.length(); i < n; i++) {
        SingleUnitImpl singleUnit = *source.units[i];
        Factor singleFactor = loadSingleFactor(singleUnit.getSimpleUnitID(), ratesInfo, status);
        if (U_FAILURE(status)) return result;
        singleFactor.applySiPrefix(singleUnit.siPrefix);
        singleFactor.power(singleUnit.dimensionality);
        result.multiplyBy(singleFactor);
    }
    return result;
}
Factor loadCompoundFactor ( const MeasureUnitImpl & source , const ConversionRates & ratesInfo , UErrorCode & status ) { Factor result ; for ( int32_t i = 0 , n = source . units . length ( ) ; i < n ; i ++ ) { SingleUnitImpl singleUnit = * source . units [ i ] ; Factor singleFactor = loadSingleFactor ( singleUnit . getSimpleUnitID ( ) , ratesInfo , status ) ; if ( U_FAILURE ( status ) ) return result ; singleFactor . applySiPrefix ( singleUnit . siPrefix ) ; singleFactor . power ( singleUnit . dimensionality ) ; result . multiplyBy ( singleFactor ) ; } return result ; }
Load Factor of a compound source unit.
Load Factor of a compound source unit .
// Apply SiPrefix before the power, because the power may be will flip the factor. // Apply the power of the `dimensionality`