コード例 #1
0
 private bool AreExponentsEqualTo(QuantityDimension other)
 {
     return(other.LengthExponent == LengthExponent && other.MassExponent == MassExponent &&
            other.TimeExponent == TimeExponent &&
            other.ElectricCurrentExponent == ElectricCurrentExponent &&
            other.TemperatureExponent == TemperatureExponent &&
            other.LuminousIntensityExponent == LuminousIntensityExponent &&
            other.AmountOfSubstanceExponent == AmountOfSubstanceExponent);
 }
コード例 #2
0
 /// <summary>
 /// Compare the exponents of this object with another quantity dimension object for dimensional equality
 /// </summary>
 /// <param name="other">Quantity dimension object with which to compare dimensional equality</param>
 /// <returns>true if all exponent elements of this and the other object are equal, false otherwise</returns>
 internal bool ExponentsEqual(QuantityDimension other)
 {
     if (ReferenceEquals(objA: null, objB: other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(AreExponentsEqualTo(other));
 }
コード例 #3
0
 /// <summary>
 /// Compare this object with another quantity dimension object for equality
 /// </summary>
 /// <param name="other">Quantity dimension object with which to compare equality</param>
 /// <returns>true if all elements of this and the other object are equal, false otherwise</returns>
 internal bool Equals(QuantityDimension other)
 {
     if (ReferenceEquals(objA: null, objB: other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(Math.Abs(other.DimensionlessDifferentiator - DimensionlessDifferentiator) < EPSILON &&
            AreExponentsEqualTo(other));
 }