You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public static {_quantity.Name} From{unit.PluralName}({_quantity.ValueType}{valueParamName}) => new {_quantity.Name}({valueParamName}, {_unitEnumName}.{unit.SingularName});
149
+
public static {_quantity.Name} From{unit.PluralName}(double{valueParamName}) => new {_quantity.Name}({valueParamName}, {_unitEnumName}.{unit.SingularName});
public static {_quantity.Name} operator *({_quantity.Name} left, double right)
670
664
{{
671
665
// Logarithmic multiplication = addition
672
-
return new {_quantity.Name}(left.Value + ({_valueType})right, left.Unit);
666
+
return new {_quantity.Name}(left.Value + right, left.Unit);
673
667
}}
674
668
675
669
/// <summary>Get <see cref=""{_quantity.Name}""/> from logarithmic division of <see cref=""{_quantity.Name}""/> by value.</summary>
676
670
public static {_quantity.Name} operator /({_quantity.Name} left, double right)
677
671
{{
678
672
// Logarithmic division = subtraction
679
-
return new {_quantity.Name}(left.Value - ({_valueType})right, left.Unit);
673
+
return new {_quantity.Name}(left.Value - right, left.Unit);
680
674
}}
681
675
682
676
/// <summary>Get ratio value from logarithmic division of <see cref=""{_quantity.Name}""/> by <see cref=""{_quantity.Name}""/>.</summary>
@@ -827,15 +821,15 @@ public int CompareTo({_quantity.Name} other)
827
821
/// </para>
828
822
/// <para>
829
823
/// Note that it is advised against specifying zero difference, due to the nature
830
-
/// of floating-point operations and using {_valueType} internally.
824
+
/// of floating-point operations and using double internally.
831
825
/// </para>
832
826
/// </summary>
833
827
/// <param name=""other"">The other quantity to compare to.</param>
834
828
/// <param name=""tolerance"">The absolute or relative tolerance value. Must be greater than or equal to 0.</param>
835
829
/// <param name=""comparisonType"">The comparison type: either relative or absolute.</param>
836
830
/// <returns>True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance.</returns>
837
831
[Obsolete(""Use Equals({_quantity.Name} other, {_quantity.Name} tolerance) instead, to check equality across units and to specify the max tolerance for rounding errors due to floating-point arithmetic when converting between units."")]
838
-
public bool Equals({_quantity.Name} other, {_quantity.ValueType} tolerance, ComparisonType comparisonType)
832
+
public bool Equals({_quantity.Name} other, double tolerance, ComparisonType comparisonType)
839
833
{{
840
834
if (tolerance < 0)
841
835
throw new ArgumentOutOfRangeException(nameof(tolerance), ""Tolerance must be greater than or equal to 0."");
0 commit comments