コード例 #1
0
        /// <summary>
        /// Division operation, calculates value dividend/divisor with unit that derives from dividend unit
        /// </summary>
        /// <param name="power">a dividend (counter) - a value that is being divided</param>
        /// <param name="linearPowerLoss">a divisor (denominator) - a value which dividend is divided by</param>
        public static Length operator /(Power power, LinearPowerLoss linearPowerLoss)
        {
            // generator : MultiplyAlgebraGenerator.CreateCodeForRightFractionValue
            // scenario A
            // linearpowerloss unit will be synchronized with power unit
            var unit = new LinearPowerLossUnit(power.Unit, linearPowerLoss.Unit.DenominatorUnit);
            var linearPowerLossConverted = linearPowerLoss.WithCounterUnit(power.Unit);
            var value = power.Value / linearPowerLossConverted.Value;

            return(new Length(value, linearPowerLoss.Unit.DenominatorUnit));
        }
コード例 #2
0
 public bool Equals(LinearPowerLossUnit other)
 {
     return(CounterUnit.Equals(other.CounterUnit) && DenominatorUnit.Equals(other.DenominatorUnit));
 }