Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions UnitsNet/Comparison.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public static class Comparison
/// Absolute tolerance is defined as the maximum allowable absolute difference between <paramref name="referenceValue"/> and
/// <paramref name="otherValue"/> as a fixed number.
/// <example>
/// In this example, the two values will be equal if abs(<paramref name="referenceValue"/> - <paramref name="otherValue"/>) <= 0.01
/// In this example, the two values will be equal if abs(<paramref name="referenceValue"/> - <paramref name="otherValue"/>) &lt;= 0.01
/// <code>
/// Equals(a, b, 0.01, ComparisonType.Absolute);
/// </code>
Expand Down Expand Up @@ -102,10 +102,10 @@ public static bool EqualsRelative(double referenceValue, double otherValue, doub
/// <summary>
/// Checks if two values are equal with a given absolute tolerance.
/// <para>
/// Absolute tolerance is defined as the maximum allowable absolute difference between <paramref name="referenceValue"/> and
/// <paramref name="otherValue"/> as a fixed number.
/// Absolute tolerance is defined as the maximum allowable absolute difference between <paramref name="value1"/> and
/// <paramref name="value2"/> as a fixed number.
/// <example>
/// In this example, the two values will be equal if abs(<paramref name="referenceValue"/> - <paramref name="otherValue"/>) <= 0.01
/// In this example, the two values will be equal if abs(<paramref name="value1"/> - <paramref name="value2"/>) &lt;= 0.01
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

/// <code>
/// Equals(a, b, 0.01, ComparisonType.Absolute);
/// </code>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public static class NumberToAccelerationExtensions
public static Acceleration CentimetersPerSecondSquared<T>(this T value) => Acceleration.FromCentimetersPerSecondSquared(Convert.ToDouble(value));

/// <inheritdoc cref="Acceleration.FromCentimetersPerSecondSquared(UnitsNet.QuantityValue)" />
[Obsolete("Nullable type support has been deprecated and will be removed in a future release.")]
public static Acceleration? CentimetersPerSecondSquared<T>(this T? value) where T : struct => Acceleration.FromCentimetersPerSecondSquared(value == null ? (double?)null : Convert.ToDouble(value.Value));

#endregion
Expand All @@ -60,6 +61,7 @@ public static class NumberToAccelerationExtensions
public static Acceleration DecimetersPerSecondSquared<T>(this T value) => Acceleration.FromDecimetersPerSecondSquared(Convert.ToDouble(value));

/// <inheritdoc cref="Acceleration.FromDecimetersPerSecondSquared(UnitsNet.QuantityValue)" />
[Obsolete("Nullable type support has been deprecated and will be removed in a future release.")]
public static Acceleration? DecimetersPerSecondSquared<T>(this T? value) where T : struct => Acceleration.FromDecimetersPerSecondSquared(value == null ? (double?)null : Convert.ToDouble(value.Value));

#endregion
Expand All @@ -70,6 +72,7 @@ public static class NumberToAccelerationExtensions
public static Acceleration FeetPerSecondSquared<T>(this T value) => Acceleration.FromFeetPerSecondSquared(Convert.ToDouble(value));

/// <inheritdoc cref="Acceleration.FromFeetPerSecondSquared(UnitsNet.QuantityValue)" />
[Obsolete("Nullable type support has been deprecated and will be removed in a future release.")]
public static Acceleration? FeetPerSecondSquared<T>(this T? value) where T : struct => Acceleration.FromFeetPerSecondSquared(value == null ? (double?)null : Convert.ToDouble(value.Value));

#endregion
Expand All @@ -80,6 +83,7 @@ public static class NumberToAccelerationExtensions
public static Acceleration InchesPerSecondSquared<T>(this T value) => Acceleration.FromInchesPerSecondSquared(Convert.ToDouble(value));

/// <inheritdoc cref="Acceleration.FromInchesPerSecondSquared(UnitsNet.QuantityValue)" />
[Obsolete("Nullable type support has been deprecated and will be removed in a future release.")]
public static Acceleration? InchesPerSecondSquared<T>(this T? value) where T : struct => Acceleration.FromInchesPerSecondSquared(value == null ? (double?)null : Convert.ToDouble(value.Value));

#endregion
Expand All @@ -90,6 +94,7 @@ public static class NumberToAccelerationExtensions
public static Acceleration KilometersPerSecondSquared<T>(this T value) => Acceleration.FromKilometersPerSecondSquared(Convert.ToDouble(value));

/// <inheritdoc cref="Acceleration.FromKilometersPerSecondSquared(UnitsNet.QuantityValue)" />
[Obsolete("Nullable type support has been deprecated and will be removed in a future release.")]
public static Acceleration? KilometersPerSecondSquared<T>(this T? value) where T : struct => Acceleration.FromKilometersPerSecondSquared(value == null ? (double?)null : Convert.ToDouble(value.Value));

#endregion
Expand All @@ -100,6 +105,7 @@ public static class NumberToAccelerationExtensions
public static Acceleration KnotsPerHour<T>(this T value) => Acceleration.FromKnotsPerHour(Convert.ToDouble(value));

/// <inheritdoc cref="Acceleration.FromKnotsPerHour(UnitsNet.QuantityValue)" />
[Obsolete("Nullable type support has been deprecated and will be removed in a future release.")]
public static Acceleration? KnotsPerHour<T>(this T? value) where T : struct => Acceleration.FromKnotsPerHour(value == null ? (double?)null : Convert.ToDouble(value.Value));

#endregion
Expand All @@ -110,6 +116,7 @@ public static class NumberToAccelerationExtensions
public static Acceleration KnotsPerMinute<T>(this T value) => Acceleration.FromKnotsPerMinute(Convert.ToDouble(value));

/// <inheritdoc cref="Acceleration.FromKnotsPerMinute(UnitsNet.QuantityValue)" />
[Obsolete("Nullable type support has been deprecated and will be removed in a future release.")]
public static Acceleration? KnotsPerMinute<T>(this T? value) where T : struct => Acceleration.FromKnotsPerMinute(value == null ? (double?)null : Convert.ToDouble(value.Value));

#endregion
Expand All @@ -120,6 +127,7 @@ public static class NumberToAccelerationExtensions
public static Acceleration KnotsPerSecond<T>(this T value) => Acceleration.FromKnotsPerSecond(Convert.ToDouble(value));

/// <inheritdoc cref="Acceleration.FromKnotsPerSecond(UnitsNet.QuantityValue)" />
[Obsolete("Nullable type support has been deprecated and will be removed in a future release.")]
public static Acceleration? KnotsPerSecond<T>(this T? value) where T : struct => Acceleration.FromKnotsPerSecond(value == null ? (double?)null : Convert.ToDouble(value.Value));

#endregion
Expand All @@ -130,6 +138,7 @@ public static class NumberToAccelerationExtensions
public static Acceleration MetersPerSecondSquared<T>(this T value) => Acceleration.FromMetersPerSecondSquared(Convert.ToDouble(value));

/// <inheritdoc cref="Acceleration.FromMetersPerSecondSquared(UnitsNet.QuantityValue)" />
[Obsolete("Nullable type support has been deprecated and will be removed in a future release.")]
public static Acceleration? MetersPerSecondSquared<T>(this T? value) where T : struct => Acceleration.FromMetersPerSecondSquared(value == null ? (double?)null : Convert.ToDouble(value.Value));

#endregion
Expand All @@ -140,6 +149,7 @@ public static class NumberToAccelerationExtensions
public static Acceleration MicrometersPerSecondSquared<T>(this T value) => Acceleration.FromMicrometersPerSecondSquared(Convert.ToDouble(value));

/// <inheritdoc cref="Acceleration.FromMicrometersPerSecondSquared(UnitsNet.QuantityValue)" />
[Obsolete("Nullable type support has been deprecated and will be removed in a future release.")]
public static Acceleration? MicrometersPerSecondSquared<T>(this T? value) where T : struct => Acceleration.FromMicrometersPerSecondSquared(value == null ? (double?)null : Convert.ToDouble(value.Value));

#endregion
Expand All @@ -150,6 +160,7 @@ public static class NumberToAccelerationExtensions
public static Acceleration MillimetersPerSecondSquared<T>(this T value) => Acceleration.FromMillimetersPerSecondSquared(Convert.ToDouble(value));

/// <inheritdoc cref="Acceleration.FromMillimetersPerSecondSquared(UnitsNet.QuantityValue)" />
[Obsolete("Nullable type support has been deprecated and will be removed in a future release.")]
public static Acceleration? MillimetersPerSecondSquared<T>(this T? value) where T : struct => Acceleration.FromMillimetersPerSecondSquared(value == null ? (double?)null : Convert.ToDouble(value.Value));

#endregion
Expand All @@ -160,6 +171,7 @@ public static class NumberToAccelerationExtensions
public static Acceleration NanometersPerSecondSquared<T>(this T value) => Acceleration.FromNanometersPerSecondSquared(Convert.ToDouble(value));

/// <inheritdoc cref="Acceleration.FromNanometersPerSecondSquared(UnitsNet.QuantityValue)" />
[Obsolete("Nullable type support has been deprecated and will be removed in a future release.")]
public static Acceleration? NanometersPerSecondSquared<T>(this T? value) where T : struct => Acceleration.FromNanometersPerSecondSquared(value == null ? (double?)null : Convert.ToDouble(value.Value));

#endregion
Expand All @@ -170,6 +182,7 @@ public static class NumberToAccelerationExtensions
public static Acceleration StandardGravity<T>(this T value) => Acceleration.FromStandardGravity(Convert.ToDouble(value));

/// <inheritdoc cref="Acceleration.FromStandardGravity(UnitsNet.QuantityValue)" />
[Obsolete("Nullable type support has been deprecated and will be removed in a future release.")]
public static Acceleration? StandardGravity<T>(this T? value) where T : struct => Acceleration.FromStandardGravity(value == null ? (double?)null : Convert.ToDouble(value.Value));

#endregion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public static class NumberToAmountOfSubstanceExtensions
public static AmountOfSubstance Centimoles<T>(this T value) => AmountOfSubstance.FromCentimoles(Convert.ToDouble(value));

/// <inheritdoc cref="AmountOfSubstance.FromCentimoles(UnitsNet.QuantityValue)" />
[Obsolete("Nullable type support has been deprecated and will be removed in a future release.")]
public static AmountOfSubstance? Centimoles<T>(this T? value) where T : struct => AmountOfSubstance.FromCentimoles(value == null ? (double?)null : Convert.ToDouble(value.Value));

#endregion
Expand All @@ -60,6 +61,7 @@ public static class NumberToAmountOfSubstanceExtensions
public static AmountOfSubstance CentipoundMoles<T>(this T value) => AmountOfSubstance.FromCentipoundMoles(Convert.ToDouble(value));

/// <inheritdoc cref="AmountOfSubstance.FromCentipoundMoles(UnitsNet.QuantityValue)" />
[Obsolete("Nullable type support has been deprecated and will be removed in a future release.")]
public static AmountOfSubstance? CentipoundMoles<T>(this T? value) where T : struct => AmountOfSubstance.FromCentipoundMoles(value == null ? (double?)null : Convert.ToDouble(value.Value));

#endregion
Expand All @@ -70,6 +72,7 @@ public static class NumberToAmountOfSubstanceExtensions
public static AmountOfSubstance Decimoles<T>(this T value) => AmountOfSubstance.FromDecimoles(Convert.ToDouble(value));

/// <inheritdoc cref="AmountOfSubstance.FromDecimoles(UnitsNet.QuantityValue)" />
[Obsolete("Nullable type support has been deprecated and will be removed in a future release.")]
public static AmountOfSubstance? Decimoles<T>(this T? value) where T : struct => AmountOfSubstance.FromDecimoles(value == null ? (double?)null : Convert.ToDouble(value.Value));

#endregion
Expand All @@ -80,6 +83,7 @@ public static class NumberToAmountOfSubstanceExtensions
public static AmountOfSubstance DecipoundMoles<T>(this T value) => AmountOfSubstance.FromDecipoundMoles(Convert.ToDouble(value));

/// <inheritdoc cref="AmountOfSubstance.FromDecipoundMoles(UnitsNet.QuantityValue)" />
[Obsolete("Nullable type support has been deprecated and will be removed in a future release.")]
public static AmountOfSubstance? DecipoundMoles<T>(this T? value) where T : struct => AmountOfSubstance.FromDecipoundMoles(value == null ? (double?)null : Convert.ToDouble(value.Value));

#endregion
Expand All @@ -90,6 +94,7 @@ public static class NumberToAmountOfSubstanceExtensions
public static AmountOfSubstance Kilomoles<T>(this T value) => AmountOfSubstance.FromKilomoles(Convert.ToDouble(value));

/// <inheritdoc cref="AmountOfSubstance.FromKilomoles(UnitsNet.QuantityValue)" />
[Obsolete("Nullable type support has been deprecated and will be removed in a future release.")]
public static AmountOfSubstance? Kilomoles<T>(this T? value) where T : struct => AmountOfSubstance.FromKilomoles(value == null ? (double?)null : Convert.ToDouble(value.Value));

#endregion
Expand All @@ -100,6 +105,7 @@ public static class NumberToAmountOfSubstanceExtensions
public static AmountOfSubstance KilopoundMoles<T>(this T value) => AmountOfSubstance.FromKilopoundMoles(Convert.ToDouble(value));

/// <inheritdoc cref="AmountOfSubstance.FromKilopoundMoles(UnitsNet.QuantityValue)" />
[Obsolete("Nullable type support has been deprecated and will be removed in a future release.")]
public static AmountOfSubstance? KilopoundMoles<T>(this T? value) where T : struct => AmountOfSubstance.FromKilopoundMoles(value == null ? (double?)null : Convert.ToDouble(value.Value));

#endregion
Expand All @@ -110,6 +116,7 @@ public static class NumberToAmountOfSubstanceExtensions
public static AmountOfSubstance Micromoles<T>(this T value) => AmountOfSubstance.FromMicromoles(Convert.ToDouble(value));

/// <inheritdoc cref="AmountOfSubstance.FromMicromoles(UnitsNet.QuantityValue)" />
[Obsolete("Nullable type support has been deprecated and will be removed in a future release.")]
public static AmountOfSubstance? Micromoles<T>(this T? value) where T : struct => AmountOfSubstance.FromMicromoles(value == null ? (double?)null : Convert.ToDouble(value.Value));

#endregion
Expand All @@ -120,6 +127,7 @@ public static class NumberToAmountOfSubstanceExtensions
public static AmountOfSubstance MicropoundMoles<T>(this T value) => AmountOfSubstance.FromMicropoundMoles(Convert.ToDouble(value));

/// <inheritdoc cref="AmountOfSubstance.FromMicropoundMoles(UnitsNet.QuantityValue)" />
[Obsolete("Nullable type support has been deprecated and will be removed in a future release.")]
public static AmountOfSubstance? MicropoundMoles<T>(this T? value) where T : struct => AmountOfSubstance.FromMicropoundMoles(value == null ? (double?)null : Convert.ToDouble(value.Value));

#endregion
Expand All @@ -130,6 +138,7 @@ public static class NumberToAmountOfSubstanceExtensions
public static AmountOfSubstance Millimoles<T>(this T value) => AmountOfSubstance.FromMillimoles(Convert.ToDouble(value));

/// <inheritdoc cref="AmountOfSubstance.FromMillimoles(UnitsNet.QuantityValue)" />
[Obsolete("Nullable type support has been deprecated and will be removed in a future release.")]
public static AmountOfSubstance? Millimoles<T>(this T? value) where T : struct => AmountOfSubstance.FromMillimoles(value == null ? (double?)null : Convert.ToDouble(value.Value));

#endregion
Expand All @@ -140,6 +149,7 @@ public static class NumberToAmountOfSubstanceExtensions
public static AmountOfSubstance MillipoundMoles<T>(this T value) => AmountOfSubstance.FromMillipoundMoles(Convert.ToDouble(value));

/// <inheritdoc cref="AmountOfSubstance.FromMillipoundMoles(UnitsNet.QuantityValue)" />
[Obsolete("Nullable type support has been deprecated and will be removed in a future release.")]
public static AmountOfSubstance? MillipoundMoles<T>(this T? value) where T : struct => AmountOfSubstance.FromMillipoundMoles(value == null ? (double?)null : Convert.ToDouble(value.Value));

#endregion
Expand All @@ -150,6 +160,7 @@ public static class NumberToAmountOfSubstanceExtensions
public static AmountOfSubstance Moles<T>(this T value) => AmountOfSubstance.FromMoles(Convert.ToDouble(value));

/// <inheritdoc cref="AmountOfSubstance.FromMoles(UnitsNet.QuantityValue)" />
[Obsolete("Nullable type support has been deprecated and will be removed in a future release.")]
public static AmountOfSubstance? Moles<T>(this T? value) where T : struct => AmountOfSubstance.FromMoles(value == null ? (double?)null : Convert.ToDouble(value.Value));

#endregion
Expand All @@ -160,6 +171,7 @@ public static class NumberToAmountOfSubstanceExtensions
public static AmountOfSubstance Nanomoles<T>(this T value) => AmountOfSubstance.FromNanomoles(Convert.ToDouble(value));

/// <inheritdoc cref="AmountOfSubstance.FromNanomoles(UnitsNet.QuantityValue)" />
[Obsolete("Nullable type support has been deprecated and will be removed in a future release.")]
public static AmountOfSubstance? Nanomoles<T>(this T? value) where T : struct => AmountOfSubstance.FromNanomoles(value == null ? (double?)null : Convert.ToDouble(value.Value));

#endregion
Expand All @@ -170,6 +182,7 @@ public static class NumberToAmountOfSubstanceExtensions
public static AmountOfSubstance NanopoundMoles<T>(this T value) => AmountOfSubstance.FromNanopoundMoles(Convert.ToDouble(value));

/// <inheritdoc cref="AmountOfSubstance.FromNanopoundMoles(UnitsNet.QuantityValue)" />
[Obsolete("Nullable type support has been deprecated and will be removed in a future release.")]
public static AmountOfSubstance? NanopoundMoles<T>(this T? value) where T : struct => AmountOfSubstance.FromNanopoundMoles(value == null ? (double?)null : Convert.ToDouble(value.Value));

#endregion
Expand All @@ -180,6 +193,7 @@ public static class NumberToAmountOfSubstanceExtensions
public static AmountOfSubstance PoundMoles<T>(this T value) => AmountOfSubstance.FromPoundMoles(Convert.ToDouble(value));

/// <inheritdoc cref="AmountOfSubstance.FromPoundMoles(UnitsNet.QuantityValue)" />
[Obsolete("Nullable type support has been deprecated and will be removed in a future release.")]
public static AmountOfSubstance? PoundMoles<T>(this T? value) where T : struct => AmountOfSubstance.FromPoundMoles(value == null ? (double?)null : Convert.ToDouble(value.Value));

#endregion
Expand Down
Loading