コード例 #1
0
ファイル: Volume.generated.cs プロジェクト: pockees/Gu.Units
 /// <summary>
 /// Divides <paramref name="left"/> by <paramref name="right"/>
 /// </summary>
 /// <param name="left">The left value</param>
 /// <param name="right">The right value</param>
 /// <returns>The <see cref="Mass"/> that is the result from the division.</returns>
 public static Mass operator /(Volume left, SpecificVolume right)
 {
     return(Mass.FromKilograms(left.cubicMetres / right.cubicMetresPerKilogram));
 }
コード例 #2
0
ファイル: Force.generated.cs プロジェクト: pockees/Gu.Units
 /// <summary>
 /// Divides <paramref name="left"/> by <paramref name="right"/>
 /// </summary>
 /// <param name="left">The left value</param>
 /// <param name="right">The right value</param>
 /// <returns>The <see cref="Mass"/> that is the result from the division.</returns>
 public static Mass operator /(Force left, Acceleration right)
 {
     return(Mass.FromKilograms(left.newtons / right.metresPerSecondSquared));
 }
コード例 #3
0
 public bool Equals(Mass other, Mass tolerance)
 {
     Ensure.GreaterThan(tolerance.kilograms, 0, nameof(tolerance));
     return(Math.Abs(this.kilograms - other.kilograms) < tolerance.kilograms);
 }
コード例 #4
0
ファイル: Volume.generated.cs プロジェクト: pockees/Gu.Units
 /// <summary>
 /// Multiplies <paramref name="left"/> with <paramref name="right"/>
 /// </summary>
 /// <param name="left">The left value</param>
 /// <param name="right">The right value</param>
 /// <returns>The <see cref="Mass"/> that is the result from the multiplication.</returns>
 public static Mass operator *(Volume left, Density right)
 {
     return(Mass.FromKilograms(left.cubicMetres * right.kilogramsPerCubicMetre));
 }
コード例 #5
0
 public int CompareTo(Mass quantity)
 {
     return(this.kilograms.CompareTo(quantity.kilograms));
 }
コード例 #6
0
 public bool Equals(Mass other)
 {
     return(this.kilograms.Equals(other.kilograms));
 }
コード例 #7
0
 public static bool TryParse(string text, NumberStyles styles, IFormatProvider provider, out Mass result)
 {
     return(QuantityParser.TryParse <MassUnit, Mass>(text, From, styles, provider, out result));
 }
コード例 #8
0
 public static bool TryParse(string text, NumberStyles styles, out Mass result)
 {
     return(QuantityParser.TryParse <MassUnit, Mass>(text, From, styles, CultureInfo.CurrentCulture, out result));
 }
コード例 #9
0
 public static Mass operator *(Time left, MassFlow right)
 {
     return(Mass.FromKilograms(left.seconds * right.kilogramsPerSecond));
 }
コード例 #10
0
 public static Mass operator *(MolarMass left, AmountOfSubstance right)
 {
     return(Mass.FromKilograms(left.kilogramsPerMole * right.moles));
 }
コード例 #11
0
 /// <summary>
 /// Divides <paramref name="left"/> by <paramref name="right"/>
 /// </summary>
 /// <param name="left">The left value</param>
 /// <param name="right">The right value</param>
 /// <returns>The <see cref="Mass"/> that is the result from the division.</returns>
 public static Mass operator /(Energy left, SpecificEnergy right)
 {
     return(Mass.FromKilograms(left.joules / right.joulesPerKilogram));
 }