From ce4c327fe5e6706d609ac5369c3da359dafb731f Mon Sep 17 00:00:00 2001 From: Tristan Milnthorp Date: Thu, 21 Jun 2018 09:25:01 -0400 Subject: [PATCH 01/19] Adding ability to compare by relative and absolute values --- UnitsNet.Tests/AssertEx.cs | 20 +++- .../CustomCode/PowerDensityTests.cs | 2 + .../GeneratedCode/PowerDensityTestsBase.g.cs | 12 +++ UnitsNet/Comparison.cs | 49 ++++++++++ UnitsNet/ComparisonType.cs | 32 +++++++ .../NumberToPowerDensityExtensions.g.cs | 68 ++++++++++++++ .../Quantities/Acceleration.g.cs | 21 ++++- .../Quantities/AmountOfSubstance.g.cs | 21 ++++- .../Quantities/AmplitudeRatio.g.cs | 21 ++++- UnitsNet/GeneratedCode/Quantities/Angle.g.cs | 21 ++++- .../Quantities/ApparentEnergy.g.cs | 21 ++++- .../Quantities/ApparentPower.g.cs | 21 ++++- UnitsNet/GeneratedCode/Quantities/Area.g.cs | 21 ++++- .../GeneratedCode/Quantities/AreaDensity.g.cs | 21 ++++- .../Quantities/AreaMomentOfInertia.g.cs | 21 ++++- .../GeneratedCode/Quantities/BitRate.g.cs | 21 ++++- .../BrakeSpecificFuelConsumption.g.cs | 21 ++++- .../GeneratedCode/Quantities/Capacitance.g.cs | 21 ++++- .../GeneratedCode/Quantities/Density.g.cs | 21 ++++- .../GeneratedCode/Quantities/Duration.g.cs | 21 ++++- .../Quantities/DynamicViscosity.g.cs | 21 ++++- .../Quantities/ElectricAdmittance.g.cs | 21 ++++- .../Quantities/ElectricCharge.g.cs | 21 ++++- .../Quantities/ElectricChargeDensity.g.cs | 21 ++++- .../Quantities/ElectricConductance.g.cs | 21 ++++- .../Quantities/ElectricConductivity.g.cs | 21 ++++- .../Quantities/ElectricCurrent.g.cs | 21 ++++- .../Quantities/ElectricCurrentDensity.g.cs | 21 ++++- .../Quantities/ElectricCurrentGradient.g.cs | 21 ++++- .../Quantities/ElectricField.g.cs | 21 ++++- .../Quantities/ElectricInductance.g.cs | 21 ++++- .../Quantities/ElectricPotential.g.cs | 21 ++++- .../Quantities/ElectricPotentialAc.g.cs | 21 ++++- .../Quantities/ElectricPotentialDc.g.cs | 21 ++++- .../Quantities/ElectricResistance.g.cs | 21 ++++- .../Quantities/ElectricResistivity.g.cs | 21 ++++- UnitsNet/GeneratedCode/Quantities/Energy.g.cs | 21 ++++- .../GeneratedCode/Quantities/Entropy.g.cs | 21 ++++- UnitsNet/GeneratedCode/Quantities/Flow.g.cs | 21 ++++- UnitsNet/GeneratedCode/Quantities/Force.g.cs | 21 ++++- .../Quantities/ForceChangeRate.g.cs | 21 ++++- .../Quantities/ForcePerLength.g.cs | 21 ++++- .../GeneratedCode/Quantities/Frequency.g.cs | 21 ++++- .../GeneratedCode/Quantities/HeatFlux.g.cs | 21 ++++- .../Quantities/HeatTransferCoefficient.g.cs | 21 ++++- .../GeneratedCode/Quantities/Illuminance.g.cs | 21 ++++- .../GeneratedCode/Quantities/Information.g.cs | 21 ++++- .../GeneratedCode/Quantities/Irradiance.g.cs | 21 ++++- .../GeneratedCode/Quantities/Irradiation.g.cs | 21 ++++- .../Quantities/KinematicViscosity.g.cs | 21 ++++- .../GeneratedCode/Quantities/LapseRate.g.cs | 21 ++++- UnitsNet/GeneratedCode/Quantities/Length.g.cs | 21 ++++- UnitsNet/GeneratedCode/Quantities/Level.g.cs | 21 ++++- .../Quantities/LinearDensity.g.cs | 21 ++++- .../Quantities/LuminousFlux.g.cs | 21 ++++- .../Quantities/LuminousIntensity.g.cs | 21 ++++- .../Quantities/MagneticField.g.cs | 21 ++++- .../Quantities/MagneticFlux.g.cs | 21 ++++- .../Quantities/Magnetization.g.cs | 21 ++++- UnitsNet/GeneratedCode/Quantities/Mass.g.cs | 21 ++++- .../GeneratedCode/Quantities/MassFlow.g.cs | 21 ++++- .../GeneratedCode/Quantities/MassFlux.g.cs | 21 ++++- .../Quantities/MassMomentOfInertia.g.cs | 21 ++++- .../GeneratedCode/Quantities/MolarEnergy.g.cs | 21 ++++- .../Quantities/MolarEntropy.g.cs | 21 ++++- .../GeneratedCode/Quantities/MolarMass.g.cs | 21 ++++- .../GeneratedCode/Quantities/Molarity.g.cs | 21 ++++- .../Quantities/Permeability.g.cs | 21 ++++- .../Quantities/Permittivity.g.cs | 21 ++++- UnitsNet/GeneratedCode/Quantities/Power.g.cs | 21 ++++- .../Quantities/PowerDensity.g.cs | 91 ++++++++++++++++++- .../GeneratedCode/Quantities/PowerRatio.g.cs | 21 ++++- .../GeneratedCode/Quantities/Pressure.g.cs | 21 ++++- .../Quantities/PressureChangeRate.g.cs | 21 ++++- UnitsNet/GeneratedCode/Quantities/Ratio.g.cs | 21 ++++- .../Quantities/ReactiveEnergy.g.cs | 21 ++++- .../Quantities/ReactivePower.g.cs | 21 ++++- .../Quantities/RotationalAcceleration.g.cs | 21 ++++- .../Quantities/RotationalSpeed.g.cs | 21 ++++- .../Quantities/RotationalStiffness.g.cs | 21 ++++- .../RotationalStiffnessPerLength.g.cs | 21 ++++- .../GeneratedCode/Quantities/SolidAngle.g.cs | 21 ++++- .../Quantities/SpecificEnergy.g.cs | 21 ++++- .../Quantities/SpecificEntropy.g.cs | 21 ++++- .../Quantities/SpecificVolume.g.cs | 21 ++++- .../Quantities/SpecificWeight.g.cs | 21 ++++- UnitsNet/GeneratedCode/Quantities/Speed.g.cs | 21 ++++- .../GeneratedCode/Quantities/Temperature.g.cs | 21 ++++- .../Quantities/TemperatureChangeRate.g.cs | 21 ++++- .../Quantities/TemperatureDelta.g.cs | 21 ++++- .../Quantities/ThermalConductivity.g.cs | 21 ++++- .../Quantities/ThermalResistance.g.cs | 21 ++++- UnitsNet/GeneratedCode/Quantities/Torque.g.cs | 21 ++++- .../GeneratedCode/Quantities/VitaminA.g.cs | 21 ++++- UnitsNet/GeneratedCode/Quantities/Volume.g.cs | 21 ++++- .../GeneratedCode/Quantities/VolumeFlow.g.cs | 21 ++++- .../GeneratedCode/UnitSystem.Default.g.cs | 10 ++ .../GeneratedCode/Units/PowerDensityUnit.g.cs | 2 + .../Include-GenerateQuantitySourceCode.ps1 | 21 ++++- UnitsNet/UnitDefinitions/PowerDensity.json | 2 +- 100 files changed, 2083 insertions(+), 95 deletions(-) create mode 100644 UnitsNet/Comparison.cs create mode 100644 UnitsNet/ComparisonType.cs diff --git a/UnitsNet.Tests/AssertEx.cs b/UnitsNet.Tests/AssertEx.cs index b6d90fab79..bce42bdeec 100644 --- a/UnitsNet.Tests/AssertEx.cs +++ b/UnitsNet.Tests/AssertEx.cs @@ -1,4 +1,5 @@ -using Xunit; +using System; +using Xunit; namespace UnitsNet.Tests { @@ -7,9 +8,22 @@ namespace UnitsNet.Tests /// public static class AssertEx { - public static void EqualTolerance(double expected, double actual, double tolerance) + public static void EqualTolerance(double expected, double actual, double tolerance, ComparisonType comparisonType = ComparisonType.Relative) { - Assert.True(actual >= expected - tolerance && actual <= expected + tolerance, $"Values are not equal within tolerance: {tolerance}\nExpected: {expected}\nActual: {actual}\nDiff: {actual - expected:e}"); + if(comparisonType == ComparisonType.Relative) + { + bool areEqual = UnitsNet.Comparison.EqualsRelative(expected, actual, tolerance); + + double difference = Math.Abs(expected - actual); + double percentDifference = (difference / actual) * 100.0d; + + Assert.True( areEqual, $"Values are not equal within relative tolerance: {tolerance * 100.0d}%\nExpected: {expected}\nActual: {actual}\nDiff: {percentDifference}%" ); + } + else if( comparisonType == ComparisonType.Absolute ) + { + bool areEqual = UnitsNet.Comparison.EqualsAbsolute(expected, actual, tolerance); + Assert.True( areEqual, $"Values are not equal within absolute tolerance: {tolerance}\nExpected: {expected}\nActual: {actual}\nDiff: {actual - expected:e}" ); + } } } } diff --git a/UnitsNet.Tests/CustomCode/PowerDensityTests.cs b/UnitsNet.Tests/CustomCode/PowerDensityTests.cs index abc3dfac11..9b26ed43f3 100644 --- a/UnitsNet.Tests/CustomCode/PowerDensityTests.cs +++ b/UnitsNet.Tests/CustomCode/PowerDensityTests.cs @@ -47,6 +47,7 @@ namespace UnitsNet.Tests.CustomCode public class PowerDensityTests : PowerDensityTestsBase { protected override double WattsPerCubicMeterInOneWattPerCubicMeter => 1; + protected override double FemtowattsPerCubicMeterInOneWattPerCubicMeter => 1e15; protected override double PicowattsPerCubicMeterInOneWattPerCubicMeter => 1e12; protected override double NanowattsPerCubicMeterInOneWattPerCubicMeter => 1e9; protected override double MicrowattsPerCubicMeterInOneWattPerCubicMeter => 1e6; @@ -57,6 +58,7 @@ public class PowerDensityTests : PowerDensityTestsBase protected override double MegawattsPerCubicMeterInOneWattPerCubicMeter => 1e-6; protected override double GigawattsPerCubicMeterInOneWattPerCubicMeter => 1e-9; protected override double TerawattsPerCubicMeterInOneWattPerCubicMeter => 1e-12; + protected override double PetawattsPerCubicMeterInOneWattPerCubicMeter => 1e-15; protected override double WattsPerCubicInchInOneWattPerCubicMeter => 1.6387064e-5; protected override double PicowattsPerCubicInchInOneWattPerCubicMeter => 1.6387064e7; diff --git a/UnitsNet.Tests/GeneratedCode/PowerDensityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/PowerDensityTestsBase.g.cs index 64cfa350c2..df98206cfa 100644 --- a/UnitsNet.Tests/GeneratedCode/PowerDensityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/PowerDensityTestsBase.g.cs @@ -60,6 +60,7 @@ public abstract partial class PowerDensityTestsBase protected abstract double DeciwattsPerCubicInchInOneWattPerCubicMeter { get; } protected abstract double DeciwattsPerCubicMeterInOneWattPerCubicMeter { get; } protected abstract double DeciwattsPerLiterInOneWattPerCubicMeter { get; } + protected abstract double FemtowattsPerCubicMeterInOneWattPerCubicMeter { get; } protected abstract double GigawattsPerCubicFootInOneWattPerCubicMeter { get; } protected abstract double GigawattsPerCubicInchInOneWattPerCubicMeter { get; } protected abstract double GigawattsPerCubicMeterInOneWattPerCubicMeter { get; } @@ -84,6 +85,7 @@ public abstract partial class PowerDensityTestsBase protected abstract double NanowattsPerCubicInchInOneWattPerCubicMeter { get; } protected abstract double NanowattsPerCubicMeterInOneWattPerCubicMeter { get; } protected abstract double NanowattsPerLiterInOneWattPerCubicMeter { get; } + protected abstract double PetawattsPerCubicMeterInOneWattPerCubicMeter { get; } protected abstract double PicowattsPerCubicFootInOneWattPerCubicMeter { get; } protected abstract double PicowattsPerCubicInchInOneWattPerCubicMeter { get; } protected abstract double PicowattsPerCubicMeterInOneWattPerCubicMeter { get; } @@ -106,6 +108,7 @@ public abstract partial class PowerDensityTestsBase protected virtual double DeciwattsPerCubicInchTolerance { get { return 1e-5; } } protected virtual double DeciwattsPerCubicMeterTolerance { get { return 1e-5; } } protected virtual double DeciwattsPerLiterTolerance { get { return 1e-5; } } + protected virtual double FemtowattsPerCubicMeterTolerance { get { return 1e-5; } } protected virtual double GigawattsPerCubicFootTolerance { get { return 1e-5; } } protected virtual double GigawattsPerCubicInchTolerance { get { return 1e-5; } } protected virtual double GigawattsPerCubicMeterTolerance { get { return 1e-5; } } @@ -130,6 +133,7 @@ public abstract partial class PowerDensityTestsBase protected virtual double NanowattsPerCubicInchTolerance { get { return 1e-5; } } protected virtual double NanowattsPerCubicMeterTolerance { get { return 1e-5; } } protected virtual double NanowattsPerLiterTolerance { get { return 1e-5; } } + protected virtual double PetawattsPerCubicMeterTolerance { get { return 1e-5; } } protected virtual double PicowattsPerCubicFootTolerance { get { return 1e-5; } } protected virtual double PicowattsPerCubicInchTolerance { get { return 1e-5; } } protected virtual double PicowattsPerCubicMeterTolerance { get { return 1e-5; } } @@ -156,6 +160,7 @@ public void WattPerCubicMeterToPowerDensityUnits() AssertEx.EqualTolerance(DeciwattsPerCubicInchInOneWattPerCubicMeter, wattpercubicmeter.DeciwattsPerCubicInch, DeciwattsPerCubicInchTolerance); AssertEx.EqualTolerance(DeciwattsPerCubicMeterInOneWattPerCubicMeter, wattpercubicmeter.DeciwattsPerCubicMeter, DeciwattsPerCubicMeterTolerance); AssertEx.EqualTolerance(DeciwattsPerLiterInOneWattPerCubicMeter, wattpercubicmeter.DeciwattsPerLiter, DeciwattsPerLiterTolerance); + AssertEx.EqualTolerance(FemtowattsPerCubicMeterInOneWattPerCubicMeter, wattpercubicmeter.FemtowattsPerCubicMeter, FemtowattsPerCubicMeterTolerance); AssertEx.EqualTolerance(GigawattsPerCubicFootInOneWattPerCubicMeter, wattpercubicmeter.GigawattsPerCubicFoot, GigawattsPerCubicFootTolerance); AssertEx.EqualTolerance(GigawattsPerCubicInchInOneWattPerCubicMeter, wattpercubicmeter.GigawattsPerCubicInch, GigawattsPerCubicInchTolerance); AssertEx.EqualTolerance(GigawattsPerCubicMeterInOneWattPerCubicMeter, wattpercubicmeter.GigawattsPerCubicMeter, GigawattsPerCubicMeterTolerance); @@ -180,6 +185,7 @@ public void WattPerCubicMeterToPowerDensityUnits() AssertEx.EqualTolerance(NanowattsPerCubicInchInOneWattPerCubicMeter, wattpercubicmeter.NanowattsPerCubicInch, NanowattsPerCubicInchTolerance); AssertEx.EqualTolerance(NanowattsPerCubicMeterInOneWattPerCubicMeter, wattpercubicmeter.NanowattsPerCubicMeter, NanowattsPerCubicMeterTolerance); AssertEx.EqualTolerance(NanowattsPerLiterInOneWattPerCubicMeter, wattpercubicmeter.NanowattsPerLiter, NanowattsPerLiterTolerance); + AssertEx.EqualTolerance(PetawattsPerCubicMeterInOneWattPerCubicMeter, wattpercubicmeter.PetawattsPerCubicMeter, PetawattsPerCubicMeterTolerance); AssertEx.EqualTolerance(PicowattsPerCubicFootInOneWattPerCubicMeter, wattpercubicmeter.PicowattsPerCubicFoot, PicowattsPerCubicFootTolerance); AssertEx.EqualTolerance(PicowattsPerCubicInchInOneWattPerCubicMeter, wattpercubicmeter.PicowattsPerCubicInch, PicowattsPerCubicInchTolerance); AssertEx.EqualTolerance(PicowattsPerCubicMeterInOneWattPerCubicMeter, wattpercubicmeter.PicowattsPerCubicMeter, PicowattsPerCubicMeterTolerance); @@ -205,6 +211,7 @@ public void FromValueAndUnit() AssertEx.EqualTolerance(1, PowerDensity.From(1, PowerDensityUnit.DeciwattPerCubicInch).DeciwattsPerCubicInch, DeciwattsPerCubicInchTolerance); AssertEx.EqualTolerance(1, PowerDensity.From(1, PowerDensityUnit.DeciwattPerCubicMeter).DeciwattsPerCubicMeter, DeciwattsPerCubicMeterTolerance); AssertEx.EqualTolerance(1, PowerDensity.From(1, PowerDensityUnit.DeciwattPerLiter).DeciwattsPerLiter, DeciwattsPerLiterTolerance); + AssertEx.EqualTolerance(1, PowerDensity.From(1, PowerDensityUnit.FemtowattPerCubicMeter).FemtowattsPerCubicMeter, FemtowattsPerCubicMeterTolerance); AssertEx.EqualTolerance(1, PowerDensity.From(1, PowerDensityUnit.GigawattPerCubicFoot).GigawattsPerCubicFoot, GigawattsPerCubicFootTolerance); AssertEx.EqualTolerance(1, PowerDensity.From(1, PowerDensityUnit.GigawattPerCubicInch).GigawattsPerCubicInch, GigawattsPerCubicInchTolerance); AssertEx.EqualTolerance(1, PowerDensity.From(1, PowerDensityUnit.GigawattPerCubicMeter).GigawattsPerCubicMeter, GigawattsPerCubicMeterTolerance); @@ -229,6 +236,7 @@ public void FromValueAndUnit() AssertEx.EqualTolerance(1, PowerDensity.From(1, PowerDensityUnit.NanowattPerCubicInch).NanowattsPerCubicInch, NanowattsPerCubicInchTolerance); AssertEx.EqualTolerance(1, PowerDensity.From(1, PowerDensityUnit.NanowattPerCubicMeter).NanowattsPerCubicMeter, NanowattsPerCubicMeterTolerance); AssertEx.EqualTolerance(1, PowerDensity.From(1, PowerDensityUnit.NanowattPerLiter).NanowattsPerLiter, NanowattsPerLiterTolerance); + AssertEx.EqualTolerance(1, PowerDensity.From(1, PowerDensityUnit.PetawattPerCubicMeter).PetawattsPerCubicMeter, PetawattsPerCubicMeterTolerance); AssertEx.EqualTolerance(1, PowerDensity.From(1, PowerDensityUnit.PicowattPerCubicFoot).PicowattsPerCubicFoot, PicowattsPerCubicFootTolerance); AssertEx.EqualTolerance(1, PowerDensity.From(1, PowerDensityUnit.PicowattPerCubicInch).PicowattsPerCubicInch, PicowattsPerCubicInchTolerance); AssertEx.EqualTolerance(1, PowerDensity.From(1, PowerDensityUnit.PicowattPerCubicMeter).PicowattsPerCubicMeter, PicowattsPerCubicMeterTolerance); @@ -255,6 +263,7 @@ public void As() AssertEx.EqualTolerance(DeciwattsPerCubicInchInOneWattPerCubicMeter, wattpercubicmeter.As(PowerDensityUnit.DeciwattPerCubicInch), DeciwattsPerCubicInchTolerance); AssertEx.EqualTolerance(DeciwattsPerCubicMeterInOneWattPerCubicMeter, wattpercubicmeter.As(PowerDensityUnit.DeciwattPerCubicMeter), DeciwattsPerCubicMeterTolerance); AssertEx.EqualTolerance(DeciwattsPerLiterInOneWattPerCubicMeter, wattpercubicmeter.As(PowerDensityUnit.DeciwattPerLiter), DeciwattsPerLiterTolerance); + AssertEx.EqualTolerance(FemtowattsPerCubicMeterInOneWattPerCubicMeter, wattpercubicmeter.As(PowerDensityUnit.FemtowattPerCubicMeter), FemtowattsPerCubicMeterTolerance); AssertEx.EqualTolerance(GigawattsPerCubicFootInOneWattPerCubicMeter, wattpercubicmeter.As(PowerDensityUnit.GigawattPerCubicFoot), GigawattsPerCubicFootTolerance); AssertEx.EqualTolerance(GigawattsPerCubicInchInOneWattPerCubicMeter, wattpercubicmeter.As(PowerDensityUnit.GigawattPerCubicInch), GigawattsPerCubicInchTolerance); AssertEx.EqualTolerance(GigawattsPerCubicMeterInOneWattPerCubicMeter, wattpercubicmeter.As(PowerDensityUnit.GigawattPerCubicMeter), GigawattsPerCubicMeterTolerance); @@ -279,6 +288,7 @@ public void As() AssertEx.EqualTolerance(NanowattsPerCubicInchInOneWattPerCubicMeter, wattpercubicmeter.As(PowerDensityUnit.NanowattPerCubicInch), NanowattsPerCubicInchTolerance); AssertEx.EqualTolerance(NanowattsPerCubicMeterInOneWattPerCubicMeter, wattpercubicmeter.As(PowerDensityUnit.NanowattPerCubicMeter), NanowattsPerCubicMeterTolerance); AssertEx.EqualTolerance(NanowattsPerLiterInOneWattPerCubicMeter, wattpercubicmeter.As(PowerDensityUnit.NanowattPerLiter), NanowattsPerLiterTolerance); + AssertEx.EqualTolerance(PetawattsPerCubicMeterInOneWattPerCubicMeter, wattpercubicmeter.As(PowerDensityUnit.PetawattPerCubicMeter), PetawattsPerCubicMeterTolerance); AssertEx.EqualTolerance(PicowattsPerCubicFootInOneWattPerCubicMeter, wattpercubicmeter.As(PowerDensityUnit.PicowattPerCubicFoot), PicowattsPerCubicFootTolerance); AssertEx.EqualTolerance(PicowattsPerCubicInchInOneWattPerCubicMeter, wattpercubicmeter.As(PowerDensityUnit.PicowattPerCubicInch), PicowattsPerCubicInchTolerance); AssertEx.EqualTolerance(PicowattsPerCubicMeterInOneWattPerCubicMeter, wattpercubicmeter.As(PowerDensityUnit.PicowattPerCubicMeter), PicowattsPerCubicMeterTolerance); @@ -305,6 +315,7 @@ public void ConversionRoundTrip() AssertEx.EqualTolerance(1, PowerDensity.FromDeciwattsPerCubicInch(wattpercubicmeter.DeciwattsPerCubicInch).WattsPerCubicMeter, DeciwattsPerCubicInchTolerance); AssertEx.EqualTolerance(1, PowerDensity.FromDeciwattsPerCubicMeter(wattpercubicmeter.DeciwattsPerCubicMeter).WattsPerCubicMeter, DeciwattsPerCubicMeterTolerance); AssertEx.EqualTolerance(1, PowerDensity.FromDeciwattsPerLiter(wattpercubicmeter.DeciwattsPerLiter).WattsPerCubicMeter, DeciwattsPerLiterTolerance); + AssertEx.EqualTolerance(1, PowerDensity.FromFemtowattsPerCubicMeter(wattpercubicmeter.FemtowattsPerCubicMeter).WattsPerCubicMeter, FemtowattsPerCubicMeterTolerance); AssertEx.EqualTolerance(1, PowerDensity.FromGigawattsPerCubicFoot(wattpercubicmeter.GigawattsPerCubicFoot).WattsPerCubicMeter, GigawattsPerCubicFootTolerance); AssertEx.EqualTolerance(1, PowerDensity.FromGigawattsPerCubicInch(wattpercubicmeter.GigawattsPerCubicInch).WattsPerCubicMeter, GigawattsPerCubicInchTolerance); AssertEx.EqualTolerance(1, PowerDensity.FromGigawattsPerCubicMeter(wattpercubicmeter.GigawattsPerCubicMeter).WattsPerCubicMeter, GigawattsPerCubicMeterTolerance); @@ -329,6 +340,7 @@ public void ConversionRoundTrip() AssertEx.EqualTolerance(1, PowerDensity.FromNanowattsPerCubicInch(wattpercubicmeter.NanowattsPerCubicInch).WattsPerCubicMeter, NanowattsPerCubicInchTolerance); AssertEx.EqualTolerance(1, PowerDensity.FromNanowattsPerCubicMeter(wattpercubicmeter.NanowattsPerCubicMeter).WattsPerCubicMeter, NanowattsPerCubicMeterTolerance); AssertEx.EqualTolerance(1, PowerDensity.FromNanowattsPerLiter(wattpercubicmeter.NanowattsPerLiter).WattsPerCubicMeter, NanowattsPerLiterTolerance); + AssertEx.EqualTolerance(1, PowerDensity.FromPetawattsPerCubicMeter(wattpercubicmeter.PetawattsPerCubicMeter).WattsPerCubicMeter, PetawattsPerCubicMeterTolerance); AssertEx.EqualTolerance(1, PowerDensity.FromPicowattsPerCubicFoot(wattpercubicmeter.PicowattsPerCubicFoot).WattsPerCubicMeter, PicowattsPerCubicFootTolerance); AssertEx.EqualTolerance(1, PowerDensity.FromPicowattsPerCubicInch(wattpercubicmeter.PicowattsPerCubicInch).WattsPerCubicMeter, PicowattsPerCubicInchTolerance); AssertEx.EqualTolerance(1, PowerDensity.FromPicowattsPerCubicMeter(wattpercubicmeter.PicowattsPerCubicMeter).WattsPerCubicMeter, PicowattsPerCubicMeterTolerance); diff --git a/UnitsNet/Comparison.cs b/UnitsNet/Comparison.cs new file mode 100644 index 0000000000..02975f3728 --- /dev/null +++ b/UnitsNet/Comparison.cs @@ -0,0 +1,49 @@ +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +using System; + +namespace UnitsNet +{ + public class Comparison + { + public static bool Equals( double value1, double value2, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + if(comparisonType == ComparisonType.Relative) + return EqualsRelative(value1, value2, tolerance); + else if(comparisonType == ComparisonType.Absolute) + return EqualsAbsolute(value1, value2, tolerance); + else + throw new InvalidOperationException("The ComparisonType is unsupported."); + } + + public static bool EqualsRelative( double value1, double value2, double tolerance = 0.00001) + { + double maxVariation = Math.Abs( value1 * tolerance ); + return Math.Abs( value1 - value2 ) <= maxVariation; + } + + public static bool EqualsAbsolute( double value1, double value2, double tolerance = 0.00001) + { + return Math.Abs( value1 - value2 ) <= tolerance; + } + } +} diff --git a/UnitsNet/ComparisonType.cs b/UnitsNet/ComparisonType.cs new file mode 100644 index 0000000000..5d9a35ec1e --- /dev/null +++ b/UnitsNet/ComparisonType.cs @@ -0,0 +1,32 @@ +// Copyright (c) 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). +// https://github.com/angularsen/UnitsNet +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +namespace UnitsNet +{ + /// + /// Specifies if the comparison between numbers is absolute or relative. + /// + public enum ComparisonType + { + Relative, + Absolute + } +} diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToPowerDensityExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToPowerDensityExtensions.g.cs index c421ff6fb1..e4ce1c4b70 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToPowerDensityExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToPowerDensityExtensions.g.cs @@ -316,6 +316,40 @@ public static class NumberToPowerDensityExtensions #endregion + #region FemtowattPerCubicMeter + + /// + public static PowerDensity FemtowattsPerCubicMeter(this int value) => PowerDensity.FromFemtowattsPerCubicMeter(value); + + /// + public static PowerDensity? FemtowattsPerCubicMeter(this int? value) => PowerDensity.FromFemtowattsPerCubicMeter(value); + + /// + public static PowerDensity FemtowattsPerCubicMeter(this long value) => PowerDensity.FromFemtowattsPerCubicMeter(value); + + /// + public static PowerDensity? FemtowattsPerCubicMeter(this long? value) => PowerDensity.FromFemtowattsPerCubicMeter(value); + + /// + public static PowerDensity FemtowattsPerCubicMeter(this double value) => PowerDensity.FromFemtowattsPerCubicMeter(value); + + /// + public static PowerDensity? FemtowattsPerCubicMeter(this double? value) => PowerDensity.FromFemtowattsPerCubicMeter(value); + + /// + public static PowerDensity FemtowattsPerCubicMeter(this float value) => PowerDensity.FromFemtowattsPerCubicMeter(value); + + /// + public static PowerDensity? FemtowattsPerCubicMeter(this float? value) => PowerDensity.FromFemtowattsPerCubicMeter(value); + + /// + public static PowerDensity FemtowattsPerCubicMeter(this decimal value) => PowerDensity.FromFemtowattsPerCubicMeter(Convert.ToDouble(value)); + + /// + public static PowerDensity? FemtowattsPerCubicMeter(this decimal? value) => PowerDensity.FromFemtowattsPerCubicMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); + + #endregion + #region GigawattPerCubicFoot /// @@ -1132,6 +1166,40 @@ public static class NumberToPowerDensityExtensions #endregion + #region PetawattPerCubicMeter + + /// + public static PowerDensity PetawattsPerCubicMeter(this int value) => PowerDensity.FromPetawattsPerCubicMeter(value); + + /// + public static PowerDensity? PetawattsPerCubicMeter(this int? value) => PowerDensity.FromPetawattsPerCubicMeter(value); + + /// + public static PowerDensity PetawattsPerCubicMeter(this long value) => PowerDensity.FromPetawattsPerCubicMeter(value); + + /// + public static PowerDensity? PetawattsPerCubicMeter(this long? value) => PowerDensity.FromPetawattsPerCubicMeter(value); + + /// + public static PowerDensity PetawattsPerCubicMeter(this double value) => PowerDensity.FromPetawattsPerCubicMeter(value); + + /// + public static PowerDensity? PetawattsPerCubicMeter(this double? value) => PowerDensity.FromPetawattsPerCubicMeter(value); + + /// + public static PowerDensity PetawattsPerCubicMeter(this float value) => PowerDensity.FromPetawattsPerCubicMeter(value); + + /// + public static PowerDensity? PetawattsPerCubicMeter(this float? value) => PowerDensity.FromPetawattsPerCubicMeter(value); + + /// + public static PowerDensity PetawattsPerCubicMeter(this decimal value) => PowerDensity.FromPetawattsPerCubicMeter(Convert.ToDouble(value)); + + /// + public static PowerDensity? PetawattsPerCubicMeter(this decimal? value) => PowerDensity.FromPetawattsPerCubicMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); + + #endregion + #region PicowattPerCubicFoot /// diff --git a/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs b/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs index 3a9872cd8a..185d713d7a 100644 --- a/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs @@ -790,6 +790,25 @@ public override bool Equals(object obj) return AsBaseUnitMetersPerSecondSquared().Equals(((Acceleration) obj).AsBaseUnitMetersPerSecondSquared()); } + /// + /// Compare equality to another Acceleration within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(Acceleration other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitMetersPerSecondSquared(); + double otherBaseValue = (double)other.AsBaseUnitMetersPerSecondSquared(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another Acceleration by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -805,7 +824,7 @@ public bool Equals(Acceleration other, Acceleration maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs index ddecc5157f..8c5f0d2826 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs @@ -823,6 +823,25 @@ public override bool Equals(object obj) return AsBaseUnitMoles().Equals(((AmountOfSubstance) obj).AsBaseUnitMoles()); } + /// + /// Compare equality to another AmountOfSubstance within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(AmountOfSubstance other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitMoles(); + double otherBaseValue = (double)other.AsBaseUnitMoles(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another AmountOfSubstance by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -838,7 +857,7 @@ public bool Equals(AmountOfSubstance other, AmountOfSubstance maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs index 1d85fc5ce5..a63ca30bb0 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs @@ -501,6 +501,25 @@ public override bool Equals(object obj) return AsBaseUnitDecibelVolts().Equals(((AmplitudeRatio) obj).AsBaseUnitDecibelVolts()); } + /// + /// Compare equality to another AmplitudeRatio within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(AmplitudeRatio other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitDecibelVolts(); + double otherBaseValue = (double)other.AsBaseUnitDecibelVolts(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another AmplitudeRatio by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -516,7 +535,7 @@ public bool Equals(AmplitudeRatio other, AmplitudeRatio maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Angle.g.cs b/UnitsNet/GeneratedCode/Quantities/Angle.g.cs index 74d24a05ba..103a329bd6 100644 --- a/UnitsNet/GeneratedCode/Quantities/Angle.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Angle.g.cs @@ -823,6 +823,25 @@ public override bool Equals(object obj) return AsBaseUnitDegrees().Equals(((Angle) obj).AsBaseUnitDegrees()); } + /// + /// Compare equality to another Angle within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(Angle other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitDegrees(); + double otherBaseValue = (double)other.AsBaseUnitDegrees(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another Angle by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -838,7 +857,7 @@ public bool Equals(Angle other, Angle maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs index 1cb403474d..1468d5c570 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs @@ -460,6 +460,25 @@ public override bool Equals(object obj) return AsBaseUnitVoltampereHours().Equals(((ApparentEnergy) obj).AsBaseUnitVoltampereHours()); } + /// + /// Compare equality to another ApparentEnergy within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(ApparentEnergy other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitVoltampereHours(); + double otherBaseValue = (double)other.AsBaseUnitVoltampereHours(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another ApparentEnergy by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -475,7 +494,7 @@ public bool Equals(ApparentEnergy other, ApparentEnergy maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs index a31d23d592..22df1a3677 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs @@ -493,6 +493,25 @@ public override bool Equals(object obj) return AsBaseUnitVoltamperes().Equals(((ApparentPower) obj).AsBaseUnitVoltamperes()); } + /// + /// Compare equality to another ApparentPower within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(ApparentPower other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitVoltamperes(); + double otherBaseValue = (double)other.AsBaseUnitVoltamperes(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another ApparentPower by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -508,7 +527,7 @@ public bool Equals(ApparentPower other, ApparentPower maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Area.g.cs b/UnitsNet/GeneratedCode/Quantities/Area.g.cs index 586f36d393..3211190988 100644 --- a/UnitsNet/GeneratedCode/Quantities/Area.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Area.g.cs @@ -790,6 +790,25 @@ public override bool Equals(object obj) return AsBaseUnitSquareMeters().Equals(((Area) obj).AsBaseUnitSquareMeters()); } + /// + /// Compare equality to another Area within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(Area other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitSquareMeters(); + double otherBaseValue = (double)other.AsBaseUnitSquareMeters(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another Area by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -805,7 +824,7 @@ public bool Equals(Area other, Area maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs index 74e1a1ebad..60bbd13374 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs @@ -394,6 +394,25 @@ public override bool Equals(object obj) return AsBaseUnitKilogramsPerSquareMeter().Equals(((AreaDensity) obj).AsBaseUnitKilogramsPerSquareMeter()); } + /// + /// Compare equality to another AreaDensity within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(AreaDensity other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitKilogramsPerSquareMeter(); + double otherBaseValue = (double)other.AsBaseUnitKilogramsPerSquareMeter(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another AreaDensity by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -409,7 +428,7 @@ public bool Equals(AreaDensity other, AreaDensity maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs index 4f4b14e952..20cc3b8117 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs @@ -559,6 +559,25 @@ public override bool Equals(object obj) return AsBaseUnitMetersToTheFourth().Equals(((AreaMomentOfInertia) obj).AsBaseUnitMetersToTheFourth()); } + /// + /// Compare equality to another AreaMomentOfInertia within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(AreaMomentOfInertia other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitMetersToTheFourth(); + double otherBaseValue = (double)other.AsBaseUnitMetersToTheFourth(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another AreaMomentOfInertia by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -574,7 +593,7 @@ public bool Equals(AreaMomentOfInertia other, AreaMomentOfInertia maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/BitRate.g.cs b/UnitsNet/GeneratedCode/Quantities/BitRate.g.cs index b96fa364c1..6a0fc84796 100644 --- a/UnitsNet/GeneratedCode/Quantities/BitRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BitRate.g.cs @@ -1216,6 +1216,25 @@ public override bool Equals(object obj) return AsBaseUnitBitsPerSecond().Equals(((BitRate) obj).AsBaseUnitBitsPerSecond()); } + /// + /// Compare equality to another BitRate within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(BitRate other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitBitsPerSecond(); + double otherBaseValue = (double)other.AsBaseUnitBitsPerSecond(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another BitRate by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -1231,7 +1250,7 @@ public bool Equals(BitRate other, BitRate maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs index ee2c611339..e1654d7637 100644 --- a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs @@ -460,6 +460,25 @@ public override bool Equals(object obj) return AsBaseUnitKilogramsPerJoule().Equals(((BrakeSpecificFuelConsumption) obj).AsBaseUnitKilogramsPerJoule()); } + /// + /// Compare equality to another BrakeSpecificFuelConsumption within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(BrakeSpecificFuelConsumption other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitKilogramsPerJoule(); + double otherBaseValue = (double)other.AsBaseUnitKilogramsPerJoule(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another BrakeSpecificFuelConsumption by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -475,7 +494,7 @@ public bool Equals(BrakeSpecificFuelConsumption other, BrakeSpecificFuelConsumpt public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Capacitance.g.cs b/UnitsNet/GeneratedCode/Quantities/Capacitance.g.cs index dff690eaaf..c4a62a9d33 100644 --- a/UnitsNet/GeneratedCode/Quantities/Capacitance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Capacitance.g.cs @@ -394,6 +394,25 @@ public override bool Equals(object obj) return AsBaseUnitFarads().Equals(((Capacitance) obj).AsBaseUnitFarads()); } + /// + /// Compare equality to another Capacitance within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(Capacitance other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitFarads(); + double otherBaseValue = (double)other.AsBaseUnitFarads(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another Capacitance by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -409,7 +428,7 @@ public bool Equals(Capacitance other, Capacitance maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Density.g.cs b/UnitsNet/GeneratedCode/Quantities/Density.g.cs index de16dab4cb..5aec680f9a 100644 --- a/UnitsNet/GeneratedCode/Quantities/Density.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Density.g.cs @@ -1615,6 +1615,25 @@ public override bool Equals(object obj) return AsBaseUnitKilogramsPerCubicMeter().Equals(((Density) obj).AsBaseUnitKilogramsPerCubicMeter()); } + /// + /// Compare equality to another Density within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(Density other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitKilogramsPerCubicMeter(); + double otherBaseValue = (double)other.AsBaseUnitKilogramsPerCubicMeter(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another Density by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -1630,7 +1649,7 @@ public bool Equals(Density other, Density maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Duration.g.cs b/UnitsNet/GeneratedCode/Quantities/Duration.g.cs index 52fc199f4c..4ae4b55547 100644 --- a/UnitsNet/GeneratedCode/Quantities/Duration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Duration.g.cs @@ -759,6 +759,25 @@ public override bool Equals(object obj) return AsBaseUnitSeconds().Equals(((Duration) obj).AsBaseUnitSeconds()); } + /// + /// Compare equality to another Duration within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(Duration other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitSeconds(); + double otherBaseValue = (double)other.AsBaseUnitSeconds(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another Duration by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -774,7 +793,7 @@ public bool Equals(Duration other, Duration maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs index fafafa666a..ddb91c46bc 100644 --- a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs @@ -559,6 +559,25 @@ public override bool Equals(object obj) return AsBaseUnitNewtonSecondsPerMeterSquared().Equals(((DynamicViscosity) obj).AsBaseUnitNewtonSecondsPerMeterSquared()); } + /// + /// Compare equality to another DynamicViscosity within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(DynamicViscosity other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitNewtonSecondsPerMeterSquared(); + double otherBaseValue = (double)other.AsBaseUnitNewtonSecondsPerMeterSquared(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another DynamicViscosity by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -574,7 +593,7 @@ public bool Equals(DynamicViscosity other, DynamicViscosity maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs index b663123c83..b6b5eb9f32 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs @@ -493,6 +493,25 @@ public override bool Equals(object obj) return AsBaseUnitSiemens().Equals(((ElectricAdmittance) obj).AsBaseUnitSiemens()); } + /// + /// Compare equality to another ElectricAdmittance within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(ElectricAdmittance other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitSiemens(); + double otherBaseValue = (double)other.AsBaseUnitSiemens(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another ElectricAdmittance by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -508,7 +527,7 @@ public bool Equals(ElectricAdmittance other, ElectricAdmittance maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs index fb9846d0ae..f552025af1 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs @@ -394,6 +394,25 @@ public override bool Equals(object obj) return AsBaseUnitCoulombs().Equals(((ElectricCharge) obj).AsBaseUnitCoulombs()); } + /// + /// Compare equality to another ElectricCharge within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(ElectricCharge other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitCoulombs(); + double otherBaseValue = (double)other.AsBaseUnitCoulombs(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another ElectricCharge by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -409,7 +428,7 @@ public bool Equals(ElectricCharge other, ElectricCharge maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs index 6681cd10c9..bbc01ffe00 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs @@ -394,6 +394,25 @@ public override bool Equals(object obj) return AsBaseUnitCoulombsPerCubicMeter().Equals(((ElectricChargeDensity) obj).AsBaseUnitCoulombsPerCubicMeter()); } + /// + /// Compare equality to another ElectricChargeDensity within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(ElectricChargeDensity other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitCoulombsPerCubicMeter(); + double otherBaseValue = (double)other.AsBaseUnitCoulombsPerCubicMeter(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another ElectricChargeDensity by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -409,7 +428,7 @@ public bool Equals(ElectricChargeDensity other, ElectricChargeDensity maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs index ecd8f2671a..05e5467889 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs @@ -460,6 +460,25 @@ public override bool Equals(object obj) return AsBaseUnitSiemens().Equals(((ElectricConductance) obj).AsBaseUnitSiemens()); } + /// + /// Compare equality to another ElectricConductance within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(ElectricConductance other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitSiemens(); + double otherBaseValue = (double)other.AsBaseUnitSiemens(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another ElectricConductance by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -475,7 +494,7 @@ public bool Equals(ElectricConductance other, ElectricConductance maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs index abffdf87c6..cf28af9c81 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs @@ -394,6 +394,25 @@ public override bool Equals(object obj) return AsBaseUnitSiemensPerMeter().Equals(((ElectricConductivity) obj).AsBaseUnitSiemensPerMeter()); } + /// + /// Compare equality to another ElectricConductivity within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(ElectricConductivity other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitSiemensPerMeter(); + double otherBaseValue = (double)other.AsBaseUnitSiemensPerMeter(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another ElectricConductivity by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -409,7 +428,7 @@ public bool Equals(ElectricConductivity other, ElectricConductivity maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs index 8ed72f6186..fcc3f47031 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs @@ -592,6 +592,25 @@ public override bool Equals(object obj) return AsBaseUnitAmperes().Equals(((ElectricCurrent) obj).AsBaseUnitAmperes()); } + /// + /// Compare equality to another ElectricCurrent within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(ElectricCurrent other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitAmperes(); + double otherBaseValue = (double)other.AsBaseUnitAmperes(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another ElectricCurrent by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -607,7 +626,7 @@ public bool Equals(ElectricCurrent other, ElectricCurrent maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs index 35ec3503da..b44df0a58b 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs @@ -394,6 +394,25 @@ public override bool Equals(object obj) return AsBaseUnitAmperesPerSquareMeter().Equals(((ElectricCurrentDensity) obj).AsBaseUnitAmperesPerSquareMeter()); } + /// + /// Compare equality to another ElectricCurrentDensity within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(ElectricCurrentDensity other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitAmperesPerSquareMeter(); + double otherBaseValue = (double)other.AsBaseUnitAmperesPerSquareMeter(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another ElectricCurrentDensity by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -409,7 +428,7 @@ public bool Equals(ElectricCurrentDensity other, ElectricCurrentDensity maxError public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs index 9530470972..15b40b6b0e 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs @@ -394,6 +394,25 @@ public override bool Equals(object obj) return AsBaseUnitAmperesPerSecond().Equals(((ElectricCurrentGradient) obj).AsBaseUnitAmperesPerSecond()); } + /// + /// Compare equality to another ElectricCurrentGradient within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(ElectricCurrentGradient other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitAmperesPerSecond(); + double otherBaseValue = (double)other.AsBaseUnitAmperesPerSecond(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another ElectricCurrentGradient by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -409,7 +428,7 @@ public bool Equals(ElectricCurrentGradient other, ElectricCurrentGradient maxErr public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs index 4c27c4b531..873341962e 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs @@ -394,6 +394,25 @@ public override bool Equals(object obj) return AsBaseUnitVoltsPerMeter().Equals(((ElectricField) obj).AsBaseUnitVoltsPerMeter()); } + /// + /// Compare equality to another ElectricField within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(ElectricField other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitVoltsPerMeter(); + double otherBaseValue = (double)other.AsBaseUnitVoltsPerMeter(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another ElectricField by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -409,7 +428,7 @@ public bool Equals(ElectricField other, ElectricField maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs index b8c2b04d71..6f11f85530 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs @@ -394,6 +394,25 @@ public override bool Equals(object obj) return AsBaseUnitHenries().Equals(((ElectricInductance) obj).AsBaseUnitHenries()); } + /// + /// Compare equality to another ElectricInductance within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(ElectricInductance other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitHenries(); + double otherBaseValue = (double)other.AsBaseUnitHenries(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another ElectricInductance by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -409,7 +428,7 @@ public bool Equals(ElectricInductance other, ElectricInductance maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs index 110c4dfed4..3181d6575a 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs @@ -526,6 +526,25 @@ public override bool Equals(object obj) return AsBaseUnitVolts().Equals(((ElectricPotential) obj).AsBaseUnitVolts()); } + /// + /// Compare equality to another ElectricPotential within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(ElectricPotential other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitVolts(); + double otherBaseValue = (double)other.AsBaseUnitVolts(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another ElectricPotential by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -541,7 +560,7 @@ public bool Equals(ElectricPotential other, ElectricPotential maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.g.cs index 90e2c73f6d..f322a0e8ae 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.g.cs @@ -526,6 +526,25 @@ public override bool Equals(object obj) return AsBaseUnitVoltsAc().Equals(((ElectricPotentialAc) obj).AsBaseUnitVoltsAc()); } + /// + /// Compare equality to another ElectricPotentialAc within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(ElectricPotentialAc other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitVoltsAc(); + double otherBaseValue = (double)other.AsBaseUnitVoltsAc(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another ElectricPotentialAc by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -541,7 +560,7 @@ public bool Equals(ElectricPotentialAc other, ElectricPotentialAc maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.g.cs index 536b4942a4..2856d75f08 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.g.cs @@ -526,6 +526,25 @@ public override bool Equals(object obj) return AsBaseUnitVoltsDc().Equals(((ElectricPotentialDc) obj).AsBaseUnitVoltsDc()); } + /// + /// Compare equality to another ElectricPotentialDc within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(ElectricPotentialDc other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitVoltsDc(); + double otherBaseValue = (double)other.AsBaseUnitVoltsDc(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another ElectricPotentialDc by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -541,7 +560,7 @@ public bool Equals(ElectricPotentialDc other, ElectricPotentialDc maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs index cc667a484e..d136970736 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs @@ -493,6 +493,25 @@ public override bool Equals(object obj) return AsBaseUnitOhms().Equals(((ElectricResistance) obj).AsBaseUnitOhms()); } + /// + /// Compare equality to another ElectricResistance within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(ElectricResistance other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitOhms(); + double otherBaseValue = (double)other.AsBaseUnitOhms(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another ElectricResistance by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -508,7 +527,7 @@ public bool Equals(ElectricResistance other, ElectricResistance maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs index fd73a7644c..6ef4b53574 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs @@ -493,6 +493,25 @@ public override bool Equals(object obj) return AsBaseUnitOhmMeters().Equals(((ElectricResistivity) obj).AsBaseUnitOhmMeters()); } + /// + /// Compare equality to another ElectricResistivity within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(ElectricResistivity other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitOhmMeters(); + double otherBaseValue = (double)other.AsBaseUnitOhmMeters(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another ElectricResistivity by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -508,7 +527,7 @@ public bool Equals(ElectricResistivity other, ElectricResistivity maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Energy.g.cs b/UnitsNet/GeneratedCode/Quantities/Energy.g.cs index 6ee720d894..7a2cabb70e 100644 --- a/UnitsNet/GeneratedCode/Quantities/Energy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Energy.g.cs @@ -1087,6 +1087,25 @@ public override bool Equals(object obj) return AsBaseUnitJoules().Equals(((Energy) obj).AsBaseUnitJoules()); } + /// + /// Compare equality to another Energy within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(Energy other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitJoules(); + double otherBaseValue = (double)other.AsBaseUnitJoules(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another Energy by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -1102,7 +1121,7 @@ public bool Equals(Energy other, Energy maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs b/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs index d8ab700f54..467533994b 100644 --- a/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs @@ -592,6 +592,25 @@ public override bool Equals(object obj) return AsBaseUnitJoulesPerKelvin().Equals(((Entropy) obj).AsBaseUnitJoulesPerKelvin()); } + /// + /// Compare equality to another Entropy within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(Entropy other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitJoulesPerKelvin(); + double otherBaseValue = (double)other.AsBaseUnitJoulesPerKelvin(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another Entropy by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -607,7 +626,7 @@ public bool Equals(Entropy other, Entropy maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Flow.g.cs b/UnitsNet/GeneratedCode/Quantities/Flow.g.cs index b6039c321b..8c0bf0ab43 100644 --- a/UnitsNet/GeneratedCode/Quantities/Flow.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Flow.g.cs @@ -1171,6 +1171,25 @@ public override bool Equals(object obj) return AsBaseUnitCubicMetersPerSecond().Equals(((Flow) obj).AsBaseUnitCubicMetersPerSecond()); } + /// + /// Compare equality to another Flow within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(Flow other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitCubicMetersPerSecond(); + double otherBaseValue = (double)other.AsBaseUnitCubicMetersPerSecond(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another Flow by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -1186,7 +1205,7 @@ public bool Equals(Flow other, Flow maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Force.g.cs b/UnitsNet/GeneratedCode/Quantities/Force.g.cs index fe87ea206c..b634a747eb 100644 --- a/UnitsNet/GeneratedCode/Quantities/Force.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Force.g.cs @@ -691,6 +691,25 @@ public override bool Equals(object obj) return AsBaseUnitNewtons().Equals(((Force) obj).AsBaseUnitNewtons()); } + /// + /// Compare equality to another Force within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(Force other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitNewtons(); + double otherBaseValue = (double)other.AsBaseUnitNewtons(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another Force by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -706,7 +725,7 @@ public bool Equals(Force other, Force maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs index bb56896fde..73fced83dc 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs @@ -724,6 +724,25 @@ public override bool Equals(object obj) return AsBaseUnitNewtonsPerSecond().Equals(((ForceChangeRate) obj).AsBaseUnitNewtonsPerSecond()); } + /// + /// Compare equality to another ForceChangeRate within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(ForceChangeRate other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitNewtonsPerSecond(); + double otherBaseValue = (double)other.AsBaseUnitNewtonsPerSecond(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another ForceChangeRate by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -739,7 +758,7 @@ public bool Equals(ForceChangeRate other, ForceChangeRate maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs index 786d55dc3f..b35b791c20 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs @@ -658,6 +658,25 @@ public override bool Equals(object obj) return AsBaseUnitNewtonsPerMeter().Equals(((ForcePerLength) obj).AsBaseUnitNewtonsPerMeter()); } + /// + /// Compare equality to another ForcePerLength within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(ForcePerLength other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitNewtonsPerMeter(); + double otherBaseValue = (double)other.AsBaseUnitNewtonsPerMeter(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another ForcePerLength by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -673,7 +692,7 @@ public bool Equals(ForcePerLength other, ForcePerLength maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs b/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs index 5f9da4e58d..67ee979f45 100644 --- a/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs @@ -625,6 +625,25 @@ public override bool Equals(object obj) return AsBaseUnitHertz().Equals(((Frequency) obj).AsBaseUnitHertz()); } + /// + /// Compare equality to another Frequency within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(Frequency other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitHertz(); + double otherBaseValue = (double)other.AsBaseUnitHertz(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another Frequency by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -640,7 +659,7 @@ public bool Equals(Frequency other, Frequency maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs index 07d4788874..47a3c687ed 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs @@ -889,6 +889,25 @@ public override bool Equals(object obj) return AsBaseUnitWattsPerSquareMeter().Equals(((HeatFlux) obj).AsBaseUnitWattsPerSquareMeter()); } + /// + /// Compare equality to another HeatFlux within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(HeatFlux other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitWattsPerSquareMeter(); + double otherBaseValue = (double)other.AsBaseUnitWattsPerSquareMeter(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another HeatFlux by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -904,7 +923,7 @@ public bool Equals(HeatFlux other, HeatFlux maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs index e3707d1e25..9c0dc6bd80 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs @@ -427,6 +427,25 @@ public override bool Equals(object obj) return AsBaseUnitWattsPerSquareMeterKelvin().Equals(((HeatTransferCoefficient) obj).AsBaseUnitWattsPerSquareMeterKelvin()); } + /// + /// Compare equality to another HeatTransferCoefficient within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(HeatTransferCoefficient other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitWattsPerSquareMeterKelvin(); + double otherBaseValue = (double)other.AsBaseUnitWattsPerSquareMeterKelvin(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another HeatTransferCoefficient by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -442,7 +461,7 @@ public bool Equals(HeatTransferCoefficient other, HeatTransferCoefficient maxErr public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs b/UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs index eac52153ad..6d71fdab92 100644 --- a/UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs @@ -493,6 +493,25 @@ public override bool Equals(object obj) return AsBaseUnitLux().Equals(((Illuminance) obj).AsBaseUnitLux()); } + /// + /// Compare equality to another Illuminance within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(Illuminance other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitLux(); + double otherBaseValue = (double)other.AsBaseUnitLux(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another Illuminance by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -508,7 +527,7 @@ public bool Equals(Illuminance other, Illuminance maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Information.g.cs b/UnitsNet/GeneratedCode/Quantities/Information.g.cs index 923ae29f9e..8808a12aff 100644 --- a/UnitsNet/GeneratedCode/Quantities/Information.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Information.g.cs @@ -1216,6 +1216,25 @@ public override bool Equals(object obj) return AsBaseUnitBits().Equals(((Information) obj).AsBaseUnitBits()); } + /// + /// Compare equality to another Information within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(Information other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitBits(); + double otherBaseValue = (double)other.AsBaseUnitBits(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another Information by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -1231,7 +1250,7 @@ public bool Equals(Information other, Information maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs index 7dfb3778c7..f025af341b 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs @@ -427,6 +427,25 @@ public override bool Equals(object obj) return AsBaseUnitWattsPerSquareMeter().Equals(((Irradiance) obj).AsBaseUnitWattsPerSquareMeter()); } + /// + /// Compare equality to another Irradiance within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(Irradiance other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitWattsPerSquareMeter(); + double otherBaseValue = (double)other.AsBaseUnitWattsPerSquareMeter(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another Irradiance by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -442,7 +461,7 @@ public bool Equals(Irradiance other, Irradiance maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs index f585f4c46a..4a26fce37a 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs @@ -460,6 +460,25 @@ public override bool Equals(object obj) return AsBaseUnitJoulesPerSquareMeter().Equals(((Irradiation) obj).AsBaseUnitJoulesPerSquareMeter()); } + /// + /// Compare equality to another Irradiation within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(Irradiation other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitJoulesPerSquareMeter(); + double otherBaseValue = (double)other.AsBaseUnitJoulesPerSquareMeter(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another Irradiation by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -475,7 +494,7 @@ public bool Equals(Irradiation other, Irradiation maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs index bf8cfd0ec4..131c1c969e 100644 --- a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs @@ -625,6 +625,25 @@ public override bool Equals(object obj) return AsBaseUnitSquareMetersPerSecond().Equals(((KinematicViscosity) obj).AsBaseUnitSquareMetersPerSecond()); } + /// + /// Compare equality to another KinematicViscosity within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(KinematicViscosity other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitSquareMetersPerSecond(); + double otherBaseValue = (double)other.AsBaseUnitSquareMetersPerSecond(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another KinematicViscosity by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -640,7 +659,7 @@ public bool Equals(KinematicViscosity other, KinematicViscosity maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/LapseRate.g.cs b/UnitsNet/GeneratedCode/Quantities/LapseRate.g.cs index a9ffe2be60..2e93691de1 100644 --- a/UnitsNet/GeneratedCode/Quantities/LapseRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LapseRate.g.cs @@ -394,6 +394,25 @@ public override bool Equals(object obj) return AsBaseUnitDegreesCelciusPerKilometer().Equals(((LapseRate) obj).AsBaseUnitDegreesCelciusPerKilometer()); } + /// + /// Compare equality to another LapseRate within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(LapseRate other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitDegreesCelciusPerKilometer(); + double otherBaseValue = (double)other.AsBaseUnitDegreesCelciusPerKilometer(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another LapseRate by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -409,7 +428,7 @@ public bool Equals(LapseRate other, LapseRate maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Length.g.cs b/UnitsNet/GeneratedCode/Quantities/Length.g.cs index a9f8757439..875a6454e2 100644 --- a/UnitsNet/GeneratedCode/Quantities/Length.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Length.g.cs @@ -1087,6 +1087,25 @@ public override bool Equals(object obj) return AsBaseUnitMeters().Equals(((Length) obj).AsBaseUnitMeters()); } + /// + /// Compare equality to another Length within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(Length other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitMeters(); + double otherBaseValue = (double)other.AsBaseUnitMeters(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another Length by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -1102,7 +1121,7 @@ public bool Equals(Length other, Length maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Level.g.cs b/UnitsNet/GeneratedCode/Quantities/Level.g.cs index 247893b21f..4fabb119ee 100644 --- a/UnitsNet/GeneratedCode/Quantities/Level.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Level.g.cs @@ -435,6 +435,25 @@ public override bool Equals(object obj) return AsBaseUnitDecibels().Equals(((Level) obj).AsBaseUnitDecibels()); } + /// + /// Compare equality to another Level within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(Level other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitDecibels(); + double otherBaseValue = (double)other.AsBaseUnitDecibels(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another Level by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -450,7 +469,7 @@ public bool Equals(Level other, Level maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs index 8944e2271b..6bbf5d36a4 100644 --- a/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs @@ -460,6 +460,25 @@ public override bool Equals(object obj) return AsBaseUnitKilogramsPerMeter().Equals(((LinearDensity) obj).AsBaseUnitKilogramsPerMeter()); } + /// + /// Compare equality to another LinearDensity within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(LinearDensity other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitKilogramsPerMeter(); + double otherBaseValue = (double)other.AsBaseUnitKilogramsPerMeter(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another LinearDensity by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -475,7 +494,7 @@ public bool Equals(LinearDensity other, LinearDensity maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.g.cs index c7f8d50a50..045a3a4c9f 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.g.cs @@ -394,6 +394,25 @@ public override bool Equals(object obj) return AsBaseUnitLumens().Equals(((LuminousFlux) obj).AsBaseUnitLumens()); } + /// + /// Compare equality to another LuminousFlux within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(LuminousFlux other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitLumens(); + double otherBaseValue = (double)other.AsBaseUnitLumens(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another LuminousFlux by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -409,7 +428,7 @@ public bool Equals(LuminousFlux other, LuminousFlux maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs index 42c4f4cab3..d4066ece21 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs @@ -394,6 +394,25 @@ public override bool Equals(object obj) return AsBaseUnitCandela().Equals(((LuminousIntensity) obj).AsBaseUnitCandela()); } + /// + /// Compare equality to another LuminousIntensity within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(LuminousIntensity other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitCandela(); + double otherBaseValue = (double)other.AsBaseUnitCandela(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another LuminousIntensity by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -409,7 +428,7 @@ public bool Equals(LuminousIntensity other, LuminousIntensity maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticField.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticField.g.cs index 59de9a043a..0eef14a725 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticField.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticField.g.cs @@ -394,6 +394,25 @@ public override bool Equals(object obj) return AsBaseUnitTeslas().Equals(((MagneticField) obj).AsBaseUnitTeslas()); } + /// + /// Compare equality to another MagneticField within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(MagneticField other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitTeslas(); + double otherBaseValue = (double)other.AsBaseUnitTeslas(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another MagneticField by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -409,7 +428,7 @@ public bool Equals(MagneticField other, MagneticField maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.g.cs index 597eda1312..15d9f2cda9 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.g.cs @@ -394,6 +394,25 @@ public override bool Equals(object obj) return AsBaseUnitWebers().Equals(((MagneticFlux) obj).AsBaseUnitWebers()); } + /// + /// Compare equality to another MagneticFlux within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(MagneticFlux other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitWebers(); + double otherBaseValue = (double)other.AsBaseUnitWebers(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another MagneticFlux by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -409,7 +428,7 @@ public bool Equals(MagneticFlux other, MagneticFlux maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Magnetization.g.cs b/UnitsNet/GeneratedCode/Quantities/Magnetization.g.cs index ae906d3ea5..5fc881c9cb 100644 --- a/UnitsNet/GeneratedCode/Quantities/Magnetization.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Magnetization.g.cs @@ -394,6 +394,25 @@ public override bool Equals(object obj) return AsBaseUnitAmperesPerMeter().Equals(((Magnetization) obj).AsBaseUnitAmperesPerMeter()); } + /// + /// Compare equality to another Magnetization within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(Magnetization other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitAmperesPerMeter(); + double otherBaseValue = (double)other.AsBaseUnitAmperesPerMeter(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another Magnetization by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -409,7 +428,7 @@ public bool Equals(Magnetization other, Magnetization maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Mass.g.cs b/UnitsNet/GeneratedCode/Quantities/Mass.g.cs index eb867a9598..ca59a5f3e4 100644 --- a/UnitsNet/GeneratedCode/Quantities/Mass.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Mass.g.cs @@ -1054,6 +1054,25 @@ public override bool Equals(object obj) return AsBaseUnitKilograms().Equals(((Mass) obj).AsBaseUnitKilograms()); } + /// + /// Compare equality to another Mass within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(Mass other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitKilograms(); + double otherBaseValue = (double)other.AsBaseUnitKilograms(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another Mass by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -1069,7 +1088,7 @@ public bool Equals(Mass other, Mass maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs index 7eff096850..200cd3908c 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs @@ -856,6 +856,25 @@ public override bool Equals(object obj) return AsBaseUnitGramsPerSecond().Equals(((MassFlow) obj).AsBaseUnitGramsPerSecond()); } + /// + /// Compare equality to another MassFlow within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(MassFlow other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitGramsPerSecond(); + double otherBaseValue = (double)other.AsBaseUnitGramsPerSecond(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another MassFlow by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -871,7 +890,7 @@ public bool Equals(MassFlow other, MassFlow maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs index 21ed1155ec..8fb15f3681 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs @@ -427,6 +427,25 @@ public override bool Equals(object obj) return AsBaseUnitKilogramsPerSecondPerSquareMeter().Equals(((MassFlux) obj).AsBaseUnitKilogramsPerSecondPerSquareMeter()); } + /// + /// Compare equality to another MassFlux within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(MassFlux other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitKilogramsPerSecondPerSquareMeter(); + double otherBaseValue = (double)other.AsBaseUnitKilogramsPerSecondPerSquareMeter(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another MassFlux by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -442,7 +461,7 @@ public bool Equals(MassFlux other, MassFlux maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.g.cs b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.g.cs index 66e8822268..fe9eaee6ff 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.g.cs @@ -1219,6 +1219,25 @@ public override bool Equals(object obj) return AsBaseUnitKilogramSquareMeters().Equals(((MassMomentOfInertia) obj).AsBaseUnitKilogramSquareMeters()); } + /// + /// Compare equality to another MassMomentOfInertia within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(MassMomentOfInertia other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitKilogramSquareMeters(); + double otherBaseValue = (double)other.AsBaseUnitKilogramSquareMeters(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another MassMomentOfInertia by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -1234,7 +1253,7 @@ public bool Equals(MassMomentOfInertia other, MassMomentOfInertia maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.g.cs index 6d7a1232f0..6185aaaeae 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.g.cs @@ -460,6 +460,25 @@ public override bool Equals(object obj) return AsBaseUnitJoulesPerMole().Equals(((MolarEnergy) obj).AsBaseUnitJoulesPerMole()); } + /// + /// Compare equality to another MolarEnergy within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(MolarEnergy other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitJoulesPerMole(); + double otherBaseValue = (double)other.AsBaseUnitJoulesPerMole(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another MolarEnergy by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -475,7 +494,7 @@ public bool Equals(MolarEnergy other, MolarEnergy maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.g.cs index 8374f8c99b..b5f2d7d2d9 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.g.cs @@ -460,6 +460,25 @@ public override bool Equals(object obj) return AsBaseUnitJoulesPerMoleKelvin().Equals(((MolarEntropy) obj).AsBaseUnitJoulesPerMoleKelvin()); } + /// + /// Compare equality to another MolarEntropy within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(MolarEntropy other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitJoulesPerMoleKelvin(); + double otherBaseValue = (double)other.AsBaseUnitJoulesPerMoleKelvin(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another MolarEntropy by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -475,7 +494,7 @@ public bool Equals(MolarEntropy other, MolarEntropy maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs index cf179839d4..7cfa0f2296 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs @@ -757,6 +757,25 @@ public override bool Equals(object obj) return AsBaseUnitKilogramsPerMole().Equals(((MolarMass) obj).AsBaseUnitKilogramsPerMole()); } + /// + /// Compare equality to another MolarMass within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(MolarMass other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitKilogramsPerMole(); + double otherBaseValue = (double)other.AsBaseUnitKilogramsPerMole(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another MolarMass by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -772,7 +791,7 @@ public bool Equals(MolarMass other, MolarMass maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs b/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs index 138624c172..e0b40258e1 100644 --- a/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs @@ -625,6 +625,25 @@ public override bool Equals(object obj) return AsBaseUnitMolesPerCubicMeter().Equals(((Molarity) obj).AsBaseUnitMolesPerCubicMeter()); } + /// + /// Compare equality to another Molarity within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(Molarity other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitMolesPerCubicMeter(); + double otherBaseValue = (double)other.AsBaseUnitMolesPerCubicMeter(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another Molarity by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -640,7 +659,7 @@ public bool Equals(Molarity other, Molarity maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Permeability.g.cs b/UnitsNet/GeneratedCode/Quantities/Permeability.g.cs index 8ed2343f35..a4a6229d56 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permeability.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permeability.g.cs @@ -394,6 +394,25 @@ public override bool Equals(object obj) return AsBaseUnitHenriesPerMeter().Equals(((Permeability) obj).AsBaseUnitHenriesPerMeter()); } + /// + /// Compare equality to another Permeability within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(Permeability other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitHenriesPerMeter(); + double otherBaseValue = (double)other.AsBaseUnitHenriesPerMeter(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another Permeability by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -409,7 +428,7 @@ public bool Equals(Permeability other, Permeability maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Permittivity.g.cs b/UnitsNet/GeneratedCode/Quantities/Permittivity.g.cs index 6625857d51..860f0463c0 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permittivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permittivity.g.cs @@ -394,6 +394,25 @@ public override bool Equals(object obj) return AsBaseUnitFaradsPerMeter().Equals(((Permittivity) obj).AsBaseUnitFaradsPerMeter()); } + /// + /// Compare equality to another Permittivity within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(Permittivity other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitFaradsPerMeter(); + double otherBaseValue = (double)other.AsBaseUnitFaradsPerMeter(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another Permittivity by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -409,7 +428,7 @@ public bool Equals(Permittivity other, Permittivity maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Power.g.cs b/UnitsNet/GeneratedCode/Quantities/Power.g.cs index 5dfd0cd28a..97bbccc165 100644 --- a/UnitsNet/GeneratedCode/Quantities/Power.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Power.g.cs @@ -1018,6 +1018,25 @@ public override bool Equals(object obj) return AsBaseUnitWatts().Equals(((Power) obj).AsBaseUnitWatts()); } + /// + /// Compare equality to another Power within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(Power other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitWatts(); + double otherBaseValue = (double)other.AsBaseUnitWatts(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another Power by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -1033,7 +1052,7 @@ public bool Equals(Power other, Power maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs index 825ec950a5..dbc35bc070 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs @@ -195,6 +195,10 @@ public PowerDensity(double wattspercubicmeter) /// public double DeciwattsPerLiter => As(PowerDensityUnit.DeciwattPerLiter); /// + /// Get PowerDensity in FemtowattsPerCubicMeter. + /// + public double FemtowattsPerCubicMeter => As(PowerDensityUnit.FemtowattPerCubicMeter); + /// /// Get PowerDensity in GigawattsPerCubicFoot. /// public double GigawattsPerCubicFoot => As(PowerDensityUnit.GigawattPerCubicFoot); @@ -291,6 +295,10 @@ public PowerDensity(double wattspercubicmeter) /// public double NanowattsPerLiter => As(PowerDensityUnit.NanowattPerLiter); /// + /// Get PowerDensity in PetawattsPerCubicMeter. + /// + public double PetawattsPerCubicMeter => As(PowerDensityUnit.PetawattPerCubicMeter); + /// /// Get PowerDensity in PicowattsPerCubicFoot. /// public double PicowattsPerCubicFoot => As(PowerDensityUnit.PicowattPerCubicFoot); @@ -457,6 +465,20 @@ public static PowerDensity FromDeciwattsPerLiter(QuantityValue deciwattsperliter return new PowerDensity(value, PowerDensityUnit.DeciwattPerLiter); } + /// + /// Get PowerDensity from FemtowattsPerCubicMeter. + /// +#if WINDOWS_UWP + [Windows.Foundation.Metadata.DefaultOverload] + public static PowerDensity FromFemtowattsPerCubicMeter(double femtowattspercubicmeter) +#else + public static PowerDensity FromFemtowattsPerCubicMeter(QuantityValue femtowattspercubicmeter) +#endif + { + double value = (double) femtowattspercubicmeter; + return new PowerDensity(value, PowerDensityUnit.FemtowattPerCubicMeter); + } + /// /// Get PowerDensity from GigawattsPerCubicFoot. /// @@ -793,6 +815,20 @@ public static PowerDensity FromNanowattsPerLiter(QuantityValue nanowattsperliter return new PowerDensity(value, PowerDensityUnit.NanowattPerLiter); } + /// + /// Get PowerDensity from PetawattsPerCubicMeter. + /// +#if WINDOWS_UWP + [Windows.Foundation.Metadata.DefaultOverload] + public static PowerDensity FromPetawattsPerCubicMeter(double petawattspercubicmeter) +#else + public static PowerDensity FromPetawattsPerCubicMeter(QuantityValue petawattspercubicmeter) +#endif + { + double value = (double) petawattspercubicmeter; + return new PowerDensity(value, PowerDensityUnit.PetawattPerCubicMeter); + } + /// /// Get PowerDensity from PicowattsPerCubicFoot. /// @@ -1083,6 +1119,21 @@ public static PowerDensity FromWattsPerLiter(QuantityValue wattsperliter) } } + /// + /// Get nullable PowerDensity from nullable FemtowattsPerCubicMeter. + /// + public static PowerDensity? FromFemtowattsPerCubicMeter(QuantityValue? femtowattspercubicmeter) + { + if (femtowattspercubicmeter.HasValue) + { + return FromFemtowattsPerCubicMeter(femtowattspercubicmeter.Value); + } + else + { + return null; + } + } + /// /// Get nullable PowerDensity from nullable GigawattsPerCubicFoot. /// @@ -1443,6 +1494,21 @@ public static PowerDensity FromWattsPerLiter(QuantityValue wattsperliter) } } + /// + /// Get nullable PowerDensity from nullable PetawattsPerCubicMeter. + /// + public static PowerDensity? FromPetawattsPerCubicMeter(QuantityValue? petawattspercubicmeter) + { + if (petawattspercubicmeter.HasValue) + { + return FromPetawattsPerCubicMeter(petawattspercubicmeter.Value); + } + else + { + return null; + } + } + /// /// Get nullable PowerDensity from nullable PicowattsPerCubicFoot. /// @@ -1813,6 +1879,25 @@ public override bool Equals(object obj) return AsBaseUnitWattsPerCubicMeter().Equals(((PowerDensity) obj).AsBaseUnitWattsPerCubicMeter()); } + /// + /// Compare equality to another PowerDensity within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(PowerDensity other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitWattsPerCubicMeter(); + double otherBaseValue = (double)other.AsBaseUnitWattsPerCubicMeter(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another PowerDensity by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -1828,7 +1913,7 @@ public bool Equals(PowerDensity other, PowerDensity maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion @@ -1858,6 +1943,7 @@ public double As(PowerDensityUnit unit) case PowerDensityUnit.DeciwattPerCubicInch: return (baseUnitValue/6.102374409473228e4) / 1e-1d; case PowerDensityUnit.DeciwattPerCubicMeter: return (baseUnitValue) / 1e-1d; case PowerDensityUnit.DeciwattPerLiter: return (baseUnitValue/1.0e3) / 1e-1d; + case PowerDensityUnit.FemtowattPerCubicMeter: return (baseUnitValue) / 1e-15d; case PowerDensityUnit.GigawattPerCubicFoot: return (baseUnitValue/3.531466672148859e1) / 1e9d; case PowerDensityUnit.GigawattPerCubicInch: return (baseUnitValue/6.102374409473228e4) / 1e9d; case PowerDensityUnit.GigawattPerCubicMeter: return (baseUnitValue) / 1e9d; @@ -1882,6 +1968,7 @@ public double As(PowerDensityUnit unit) case PowerDensityUnit.NanowattPerCubicInch: return (baseUnitValue/6.102374409473228e4) / 1e-9d; case PowerDensityUnit.NanowattPerCubicMeter: return (baseUnitValue) / 1e-9d; case PowerDensityUnit.NanowattPerLiter: return (baseUnitValue/1.0e3) / 1e-9d; + case PowerDensityUnit.PetawattPerCubicMeter: return (baseUnitValue) / 1e15d; case PowerDensityUnit.PicowattPerCubicFoot: return (baseUnitValue/3.531466672148859e1) / 1e-12d; case PowerDensityUnit.PicowattPerCubicInch: return (baseUnitValue/6.102374409473228e4) / 1e-12d; case PowerDensityUnit.PicowattPerCubicMeter: return (baseUnitValue) / 1e-12d; @@ -2265,6 +2352,7 @@ private double AsBaseUnitWattsPerCubicMeter() case PowerDensityUnit.DeciwattPerCubicInch: return (_value*6.102374409473228e4) * 1e-1d; case PowerDensityUnit.DeciwattPerCubicMeter: return (_value) * 1e-1d; case PowerDensityUnit.DeciwattPerLiter: return (_value*1.0e3) * 1e-1d; + case PowerDensityUnit.FemtowattPerCubicMeter: return (_value) * 1e-15d; case PowerDensityUnit.GigawattPerCubicFoot: return (_value*3.531466672148859e1) * 1e9d; case PowerDensityUnit.GigawattPerCubicInch: return (_value*6.102374409473228e4) * 1e9d; case PowerDensityUnit.GigawattPerCubicMeter: return (_value) * 1e9d; @@ -2289,6 +2377,7 @@ private double AsBaseUnitWattsPerCubicMeter() case PowerDensityUnit.NanowattPerCubicInch: return (_value*6.102374409473228e4) * 1e-9d; case PowerDensityUnit.NanowattPerCubicMeter: return (_value) * 1e-9d; case PowerDensityUnit.NanowattPerLiter: return (_value*1.0e3) * 1e-9d; + case PowerDensityUnit.PetawattPerCubicMeter: return (_value) * 1e15d; case PowerDensityUnit.PicowattPerCubicFoot: return (_value*3.531466672148859e1) * 1e-12d; case PowerDensityUnit.PicowattPerCubicInch: return (_value*6.102374409473228e4) * 1e-12d; case PowerDensityUnit.PicowattPerCubicMeter: return (_value) * 1e-12d; diff --git a/UnitsNet/GeneratedCode/Quantities/PowerRatio.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerRatio.g.cs index 6b1217e87d..b1b834aa46 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerRatio.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerRatio.g.cs @@ -435,6 +435,25 @@ public override bool Equals(object obj) return AsBaseUnitDecibelWatts().Equals(((PowerRatio) obj).AsBaseUnitDecibelWatts()); } + /// + /// Compare equality to another PowerRatio within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(PowerRatio other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitDecibelWatts(); + double otherBaseValue = (double)other.AsBaseUnitDecibelWatts(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another PowerRatio by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -450,7 +469,7 @@ public bool Equals(PowerRatio other, PowerRatio maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs b/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs index c7543b361e..7358028a23 100644 --- a/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs @@ -1616,6 +1616,25 @@ public override bool Equals(object obj) return AsBaseUnitPascals().Equals(((Pressure) obj).AsBaseUnitPascals()); } + /// + /// Compare equality to another Pressure within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(Pressure other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitPascals(); + double otherBaseValue = (double)other.AsBaseUnitPascals(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another Pressure by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -1631,7 +1650,7 @@ public bool Equals(Pressure other, Pressure maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs index e717ac7066..c9adbc477d 100644 --- a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs @@ -493,6 +493,25 @@ public override bool Equals(object obj) return AsBaseUnitPascalsPerSecond().Equals(((PressureChangeRate) obj).AsBaseUnitPascalsPerSecond()); } + /// + /// Compare equality to another PressureChangeRate within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(PressureChangeRate other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitPascalsPerSecond(); + double otherBaseValue = (double)other.AsBaseUnitPascalsPerSecond(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another PressureChangeRate by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -508,7 +527,7 @@ public bool Equals(PressureChangeRate other, PressureChangeRate maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs b/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs index 9ea4211172..e8b1494009 100644 --- a/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs @@ -559,6 +559,25 @@ public override bool Equals(object obj) return AsBaseUnitDecimalFractions().Equals(((Ratio) obj).AsBaseUnitDecimalFractions()); } + /// + /// Compare equality to another Ratio within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(Ratio other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitDecimalFractions(); + double otherBaseValue = (double)other.AsBaseUnitDecimalFractions(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another Ratio by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -574,7 +593,7 @@ public bool Equals(Ratio other, Ratio maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.g.cs index 0517ba7833..ec2e7b1510 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.g.cs @@ -460,6 +460,25 @@ public override bool Equals(object obj) return AsBaseUnitVoltampereReactiveHours().Equals(((ReactiveEnergy) obj).AsBaseUnitVoltampereReactiveHours()); } + /// + /// Compare equality to another ReactiveEnergy within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(ReactiveEnergy other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitVoltampereReactiveHours(); + double otherBaseValue = (double)other.AsBaseUnitVoltampereReactiveHours(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another ReactiveEnergy by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -475,7 +494,7 @@ public bool Equals(ReactiveEnergy other, ReactiveEnergy maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ReactivePower.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactivePower.g.cs index f3e1800386..3cc3e55095 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactivePower.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactivePower.g.cs @@ -493,6 +493,25 @@ public override bool Equals(object obj) return AsBaseUnitVoltamperesReactive().Equals(((ReactivePower) obj).AsBaseUnitVoltamperesReactive()); } + /// + /// Compare equality to another ReactivePower within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(ReactivePower other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitVoltamperesReactive(); + double otherBaseValue = (double)other.AsBaseUnitVoltamperesReactive(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another ReactivePower by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -508,7 +527,7 @@ public bool Equals(ReactivePower other, ReactivePower maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.g.cs index 0a41d7f934..b65ed47491 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.g.cs @@ -460,6 +460,25 @@ public override bool Equals(object obj) return AsBaseUnitRadiansPerSecondSquared().Equals(((RotationalAcceleration) obj).AsBaseUnitRadiansPerSecondSquared()); } + /// + /// Compare equality to another RotationalAcceleration within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(RotationalAcceleration other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitRadiansPerSecondSquared(); + double otherBaseValue = (double)other.AsBaseUnitRadiansPerSecondSquared(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another RotationalAcceleration by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -475,7 +494,7 @@ public bool Equals(RotationalAcceleration other, RotationalAcceleration maxError public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs index 253f10001f..5367120311 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs @@ -790,6 +790,25 @@ public override bool Equals(object obj) return AsBaseUnitRadiansPerSecond().Equals(((RotationalSpeed) obj).AsBaseUnitRadiansPerSecond()); } + /// + /// Compare equality to another RotationalSpeed within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(RotationalSpeed other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitRadiansPerSecond(); + double otherBaseValue = (double)other.AsBaseUnitRadiansPerSecond(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another RotationalSpeed by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -805,7 +824,7 @@ public bool Equals(RotationalSpeed other, RotationalSpeed maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs index 22d25cf421..209a4ea73f 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs @@ -460,6 +460,25 @@ public override bool Equals(object obj) return AsBaseUnitNewtonMetersPerRadian().Equals(((RotationalStiffness) obj).AsBaseUnitNewtonMetersPerRadian()); } + /// + /// Compare equality to another RotationalStiffness within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(RotationalStiffness other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitNewtonMetersPerRadian(); + double otherBaseValue = (double)other.AsBaseUnitNewtonMetersPerRadian(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another RotationalStiffness by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -475,7 +494,7 @@ public bool Equals(RotationalStiffness other, RotationalStiffness maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs index 82c3a2e486..da76c7cdd3 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs @@ -460,6 +460,25 @@ public override bool Equals(object obj) return AsBaseUnitNewtonMetersPerRadianPerMeter().Equals(((RotationalStiffnessPerLength) obj).AsBaseUnitNewtonMetersPerRadianPerMeter()); } + /// + /// Compare equality to another RotationalStiffnessPerLength within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(RotationalStiffnessPerLength other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitNewtonMetersPerRadianPerMeter(); + double otherBaseValue = (double)other.AsBaseUnitNewtonMetersPerRadianPerMeter(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another RotationalStiffnessPerLength by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -475,7 +494,7 @@ public bool Equals(RotationalStiffnessPerLength other, RotationalStiffnessPerLen public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/SolidAngle.g.cs b/UnitsNet/GeneratedCode/Quantities/SolidAngle.g.cs index 4f4ecaa007..49719d5944 100644 --- a/UnitsNet/GeneratedCode/Quantities/SolidAngle.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SolidAngle.g.cs @@ -394,6 +394,25 @@ public override bool Equals(object obj) return AsBaseUnitSteradians().Equals(((SolidAngle) obj).AsBaseUnitSteradians()); } + /// + /// Compare equality to another SolidAngle within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(SolidAngle other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitSteradians(); + double otherBaseValue = (double)other.AsBaseUnitSteradians(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another SolidAngle by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -409,7 +428,7 @@ public bool Equals(SolidAngle other, SolidAngle maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs index 8a65fd214a..0f138790d8 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs @@ -625,6 +625,25 @@ public override bool Equals(object obj) return AsBaseUnitJoulesPerKilogram().Equals(((SpecificEnergy) obj).AsBaseUnitJoulesPerKilogram()); } + /// + /// Compare equality to another SpecificEnergy within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(SpecificEnergy other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitJoulesPerKilogram(); + double otherBaseValue = (double)other.AsBaseUnitJoulesPerKilogram(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another SpecificEnergy by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -640,7 +659,7 @@ public bool Equals(SpecificEnergy other, SpecificEnergy maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs index cdf8266131..1ae7083ab3 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs @@ -625,6 +625,25 @@ public override bool Equals(object obj) return AsBaseUnitJoulesPerKilogramKelvin().Equals(((SpecificEntropy) obj).AsBaseUnitJoulesPerKilogramKelvin()); } + /// + /// Compare equality to another SpecificEntropy within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(SpecificEntropy other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitJoulesPerKilogramKelvin(); + double otherBaseValue = (double)other.AsBaseUnitJoulesPerKilogramKelvin(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another SpecificEntropy by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -640,7 +659,7 @@ public bool Equals(SpecificEntropy other, SpecificEntropy maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs index 4a5dc471fc..74e7e0ce19 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs @@ -394,6 +394,25 @@ public override bool Equals(object obj) return AsBaseUnitCubicMetersPerKilogram().Equals(((SpecificVolume) obj).AsBaseUnitCubicMetersPerKilogram()); } + /// + /// Compare equality to another SpecificVolume within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(SpecificVolume other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitCubicMetersPerKilogram(); + double otherBaseValue = (double)other.AsBaseUnitCubicMetersPerKilogram(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another SpecificVolume by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -409,7 +428,7 @@ public bool Equals(SpecificVolume other, SpecificVolume maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs index 5ada48ead3..bae6b93595 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs @@ -922,6 +922,25 @@ public override bool Equals(object obj) return AsBaseUnitNewtonsPerCubicMeter().Equals(((SpecificWeight) obj).AsBaseUnitNewtonsPerCubicMeter()); } + /// + /// Compare equality to another SpecificWeight within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(SpecificWeight other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitNewtonsPerCubicMeter(); + double otherBaseValue = (double)other.AsBaseUnitNewtonsPerCubicMeter(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another SpecificWeight by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -937,7 +956,7 @@ public bool Equals(SpecificWeight other, SpecificWeight maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Speed.g.cs b/UnitsNet/GeneratedCode/Quantities/Speed.g.cs index 248d8d2d35..9033e08d24 100644 --- a/UnitsNet/GeneratedCode/Quantities/Speed.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Speed.g.cs @@ -1417,6 +1417,25 @@ public override bool Equals(object obj) return AsBaseUnitMetersPerSecond().Equals(((Speed) obj).AsBaseUnitMetersPerSecond()); } + /// + /// Compare equality to another Speed within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(Speed other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitMetersPerSecond(); + double otherBaseValue = (double)other.AsBaseUnitMetersPerSecond(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another Speed by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -1432,7 +1451,7 @@ public bool Equals(Speed other, Speed maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Temperature.g.cs b/UnitsNet/GeneratedCode/Quantities/Temperature.g.cs index c26a6a8650..5caabf5a08 100644 --- a/UnitsNet/GeneratedCode/Quantities/Temperature.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Temperature.g.cs @@ -583,6 +583,25 @@ public override bool Equals(object obj) return AsBaseUnitKelvins().Equals(((Temperature) obj).AsBaseUnitKelvins()); } + /// + /// Compare equality to another Temperature within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(Temperature other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitKelvins(); + double otherBaseValue = (double)other.AsBaseUnitKelvins(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another Temperature by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -598,7 +617,7 @@ public bool Equals(Temperature other, Temperature maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.g.cs index 5f0fd98d8e..8ea4fea7a7 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.g.cs @@ -691,6 +691,25 @@ public override bool Equals(object obj) return AsBaseUnitDegreesCelsiusPerSecond().Equals(((TemperatureChangeRate) obj).AsBaseUnitDegreesCelsiusPerSecond()); } + /// + /// Compare equality to another TemperatureChangeRate within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(TemperatureChangeRate other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitDegreesCelsiusPerSecond(); + double otherBaseValue = (double)other.AsBaseUnitDegreesCelsiusPerSecond(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another TemperatureChangeRate by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -706,7 +725,7 @@ public bool Equals(TemperatureChangeRate other, TemperatureChangeRate maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs index aab8361987..55f94d9f90 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs @@ -897,6 +897,25 @@ public override bool Equals(object obj) return AsBaseUnitKelvins().Equals(((TemperatureDelta) obj).AsBaseUnitKelvins()); } + /// + /// Compare equality to another TemperatureDelta within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(TemperatureDelta other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitKelvins(); + double otherBaseValue = (double)other.AsBaseUnitKelvins(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another TemperatureDelta by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -912,7 +931,7 @@ public bool Equals(TemperatureDelta other, TemperatureDelta maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.g.cs index 18419e60d3..59474b9785 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.g.cs @@ -427,6 +427,25 @@ public override bool Equals(object obj) return AsBaseUnitWattsPerMeterKelvin().Equals(((ThermalConductivity) obj).AsBaseUnitWattsPerMeterKelvin()); } + /// + /// Compare equality to another ThermalConductivity within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(ThermalConductivity other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitWattsPerMeterKelvin(); + double otherBaseValue = (double)other.AsBaseUnitWattsPerMeterKelvin(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another ThermalConductivity by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -442,7 +461,7 @@ public bool Equals(ThermalConductivity other, ThermalConductivity maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.g.cs index d4585be315..79ff69280f 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.g.cs @@ -526,6 +526,25 @@ public override bool Equals(object obj) return AsBaseUnitSquareMeterKelvinsPerKilowatt().Equals(((ThermalResistance) obj).AsBaseUnitSquareMeterKelvinsPerKilowatt()); } + /// + /// Compare equality to another ThermalResistance within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(ThermalResistance other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitSquareMeterKelvinsPerKilowatt(); + double otherBaseValue = (double)other.AsBaseUnitSquareMeterKelvinsPerKilowatt(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another ThermalResistance by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -541,7 +560,7 @@ public bool Equals(ThermalResistance other, ThermalResistance maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Torque.g.cs b/UnitsNet/GeneratedCode/Quantities/Torque.g.cs index f99ff9c8e2..43abbe735c 100644 --- a/UnitsNet/GeneratedCode/Quantities/Torque.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Torque.g.cs @@ -1054,6 +1054,25 @@ public override bool Equals(object obj) return AsBaseUnitNewtonMeters().Equals(((Torque) obj).AsBaseUnitNewtonMeters()); } + /// + /// Compare equality to another Torque within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(Torque other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitNewtonMeters(); + double otherBaseValue = (double)other.AsBaseUnitNewtonMeters(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another Torque by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -1069,7 +1088,7 @@ public bool Equals(Torque other, Torque maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/VitaminA.g.cs b/UnitsNet/GeneratedCode/Quantities/VitaminA.g.cs index 2545dd636c..e2cea68a6f 100644 --- a/UnitsNet/GeneratedCode/Quantities/VitaminA.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VitaminA.g.cs @@ -394,6 +394,25 @@ public override bool Equals(object obj) return AsBaseUnitInternationalUnits().Equals(((VitaminA) obj).AsBaseUnitInternationalUnits()); } + /// + /// Compare equality to another VitaminA within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(VitaminA other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitInternationalUnits(); + double otherBaseValue = (double)other.AsBaseUnitInternationalUnits(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another VitaminA by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -409,7 +428,7 @@ public bool Equals(VitaminA other, VitaminA maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/Volume.g.cs b/UnitsNet/GeneratedCode/Quantities/Volume.g.cs index 7f5ec2c776..2c3fd4ce57 100644 --- a/UnitsNet/GeneratedCode/Quantities/Volume.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Volume.g.cs @@ -1815,6 +1815,25 @@ public override bool Equals(object obj) return AsBaseUnitCubicMeters().Equals(((Volume) obj).AsBaseUnitCubicMeters()); } + /// + /// Compare equality to another Volume within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(Volume other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitCubicMeters(); + double otherBaseValue = (double)other.AsBaseUnitCubicMeters(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another Volume by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -1830,7 +1849,7 @@ public bool Equals(Volume other, Volume maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs index bf39259d4b..d8fb0004a8 100644 --- a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs @@ -1153,6 +1153,25 @@ public override bool Equals(object obj) return AsBaseUnitCubicMetersPerSecond().Equals(((VolumeFlow) obj).AsBaseUnitCubicMetersPerSecond()); } + /// + /// Compare equality to another VolumeFlow within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals(VolumeFlow other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnitCubicMetersPerSecond(); + double otherBaseValue = (double)other.AsBaseUnitCubicMetersPerSecond(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another VolumeFlow by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -1168,7 +1187,7 @@ public bool Equals(VolumeFlow other, VolumeFlow maxError) public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/GeneratedCode/UnitSystem.Default.g.cs b/UnitsNet/GeneratedCode/UnitSystem.Default.g.cs index 4d303080ba..8719f9feed 100644 --- a/UnitsNet/GeneratedCode/UnitSystem.Default.g.cs +++ b/UnitsNet/GeneratedCode/UnitSystem.Default.g.cs @@ -2964,6 +2964,11 @@ private static readonly ReadOnlyCollection DefaultLocalization { new AbbreviationsForCulture("en-US", "dW/l"), }), + new CulturesForEnumValue((int) PowerDensityUnit.FemtowattPerCubicMeter, + new[] + { + new AbbreviationsForCulture("en-US", "fW/m³"), + }), new CulturesForEnumValue((int) PowerDensityUnit.GigawattPerCubicFoot, new[] { @@ -3084,6 +3089,11 @@ private static readonly ReadOnlyCollection DefaultLocalization { new AbbreviationsForCulture("en-US", "nW/l"), }), + new CulturesForEnumValue((int) PowerDensityUnit.PetawattPerCubicMeter, + new[] + { + new AbbreviationsForCulture("en-US", "PW/m³"), + }), new CulturesForEnumValue((int) PowerDensityUnit.PicowattPerCubicFoot, new[] { diff --git a/UnitsNet/GeneratedCode/Units/PowerDensityUnit.g.cs b/UnitsNet/GeneratedCode/Units/PowerDensityUnit.g.cs index 3763f0bd70..e0946028c2 100644 --- a/UnitsNet/GeneratedCode/Units/PowerDensityUnit.g.cs +++ b/UnitsNet/GeneratedCode/Units/PowerDensityUnit.g.cs @@ -50,6 +50,7 @@ public enum PowerDensityUnit DeciwattPerCubicInch, DeciwattPerCubicMeter, DeciwattPerLiter, + FemtowattPerCubicMeter, GigawattPerCubicFoot, GigawattPerCubicInch, GigawattPerCubicMeter, @@ -74,6 +75,7 @@ public enum PowerDensityUnit NanowattPerCubicInch, NanowattPerCubicMeter, NanowattPerLiter, + PetawattPerCubicMeter, PicowattPerCubicFoot, PicowattPerCubicInch, PicowattPerCubicMeter, diff --git a/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 b/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 index 74e0a4d926..7112f7f8a0 100644 --- a/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 +++ b/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 @@ -444,6 +444,25 @@ namespace UnitsNet return AsBaseUnit$baseUnitPluralName().Equals((($quantityName) obj).AsBaseUnit$baseUnitPluralName()); } + /// + /// Compare equality to another $quantityName within the given absolute or relative tolerance. + /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// Note that it is advised against specifying zero difference, due to the nature + /// of floating point operations and using System.Double internally. + /// + /// The other quantity to compare to. + /// The comparison tolerance. + /// The comparison type: either relative or absolute. + /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + public bool Equals($quantityName other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + { + double baseValue = (double)AsBaseUnit$baseUnitPluralName(); + double otherBaseValue = (double)other.AsBaseUnit$baseUnitPluralName(); + + return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + } + /// /// Compare equality to another $quantityName by specifying a max allowed difference. /// Note that it is advised against specifying zero difference, due to the nature @@ -459,7 +478,7 @@ namespace UnitsNet public override int GetHashCode() { - return new { Value, Unit }.GetHashCode(); + return new { Value, Unit }.GetHashCode(); } #endregion diff --git a/UnitsNet/UnitDefinitions/PowerDensity.json b/UnitsNet/UnitDefinitions/PowerDensity.json index 67d7230c17..e4174fe390 100644 --- a/UnitsNet/UnitDefinitions/PowerDensity.json +++ b/UnitsNet/UnitDefinitions/PowerDensity.json @@ -8,7 +8,7 @@ "PluralName": "WattsPerCubicMeter", "FromUnitToBaseFunc": "x", "FromBaseToUnitFunc": "x", - "Prefixes": [ "Pico", "Nano", "Micro", "Milli", "Deci", "Deca", "Kilo", "Mega", "Giga", "Tera" ], + "Prefixes": [ "Femto", "Pico", "Nano", "Micro", "Milli", "Deci", "Deca", "Kilo", "Mega", "Giga", "Tera", "Peta" ], "Localization": [ { "Culture": "en-US", From 4272747a5f49e8a23906687b5c7f77d88e6ae7cd Mon Sep 17 00:00:00 2001 From: Tristan Milnthorp Date: Thu, 21 Jun 2018 11:58:53 -0400 Subject: [PATCH 02/19] Fixing units and tests due to new relative tolerance --- .../CustomCode/AccelerationTests.cs | 2 +- UnitsNet.Tests/CustomCode/AngleTests.cs | 4 +- UnitsNet.Tests/CustomCode/DurationTests.cs | 10 ++--- UnitsNet.Tests/CustomCode/EnergyTests.cs | 10 ++--- UnitsNet.Tests/CustomCode/ForceTests.cs | 4 +- UnitsNet.Tests/CustomCode/IrradiationTests.cs | 4 +- UnitsNet.Tests/CustomCode/MassTests.cs | 8 ++-- UnitsNet.Tests/CustomCode/PressureTests.cs | 18 ++++----- .../CustomCode/SpecificWeightTests.cs | 18 ++++----- UnitsNet.Tests/CustomCode/TorqueTests.cs | 10 ++--- UnitsNet.Tests/CustomCode/VolumeTests.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Energy.g.cs | 24 +++++------ UnitsNet/GeneratedCode/Quantities/Force.g.cs | 4 +- UnitsNet/GeneratedCode/Quantities/Mass.g.cs | 8 ++-- .../GeneratedCode/Quantities/Pressure.g.cs | 40 +++++++++---------- .../Quantities/SpecificWeight.g.cs | 40 +++++++++---------- UnitsNet/GeneratedCode/Quantities/Torque.g.cs | 24 +++++------ UnitsNet/GeneratedCode/Quantities/Volume.g.cs | 4 +- UnitsNet/UnitDefinitions/Energy.json | 12 +++--- UnitsNet/UnitDefinitions/Force.json | 4 +- UnitsNet/UnitDefinitions/Mass.json | 8 ++-- UnitsNet/UnitDefinitions/Pressure.json | 32 +++++++-------- UnitsNet/UnitDefinitions/SpecificWeight.json | 32 +++++++-------- UnitsNet/UnitDefinitions/Torque.json | 10 ++--- UnitsNet/UnitDefinitions/Volume.json | 4 +- 25 files changed, 168 insertions(+), 168 deletions(-) diff --git a/UnitsNet.Tests/CustomCode/AccelerationTests.cs b/UnitsNet.Tests/CustomCode/AccelerationTests.cs index 654dca7a75..a0bdb32dac 100644 --- a/UnitsNet.Tests/CustomCode/AccelerationTests.cs +++ b/UnitsNet.Tests/CustomCode/AccelerationTests.cs @@ -39,7 +39,7 @@ public class AccelerationTests : AccelerationTestsBase protected override double NanometersPerSecondSquaredInOneMeterPerSecondSquared => 1E9; - protected override double StandardGravityInOneMeterPerSecondSquared => 0.1019727; + protected override double StandardGravityInOneMeterPerSecondSquared => 1.019716212977928e-1; protected override double InchesPerSecondSquaredInOneMeterPerSecondSquared => 39.3700787; diff --git a/UnitsNet.Tests/CustomCode/AngleTests.cs b/UnitsNet.Tests/CustomCode/AngleTests.cs index 1a1c971cb2..02708e8abb 100644 --- a/UnitsNet.Tests/CustomCode/AngleTests.cs +++ b/UnitsNet.Tests/CustomCode/AngleTests.cs @@ -52,9 +52,9 @@ public class AngleTests : AngleTestsBase protected override double ArcsecondsInOneDegree => 3600.0; - protected override double RevolutionsInOneDegree => 2.77E-3; + protected override double RevolutionsInOneDegree => 2.777777777777777e-3; - [Fact] + [ Fact] public void AngleDividedByDurationEqualsRotationalSpeed() { RotationalSpeed rotationalSpeed = Angle.FromRadians(10) / Duration.FromSeconds(5); diff --git a/UnitsNet.Tests/CustomCode/DurationTests.cs b/UnitsNet.Tests/CustomCode/DurationTests.cs index f6e4deac2c..4ad5c3338e 100644 --- a/UnitsNet.Tests/CustomCode/DurationTests.cs +++ b/UnitsNet.Tests/CustomCode/DurationTests.cs @@ -36,19 +36,19 @@ public class DurationTests : DurationTestsBase protected override double MinutesInOneSecond => 0.0166667; - protected override double MonthsInOneSecond => 3.8027e-7; + protected override double MonthsInOneSecond => 3.858024691358024e-7; - protected override double Months30InOneSecond => 3.85802469135e-7; + protected override double Months30InOneSecond => 3.858024691358024e-7; protected override double NanosecondsInOneSecond => 1e+9; protected override double SecondsInOneSecond => 1; - protected override double WeeksInOneSecond => 1.6534e-6; + protected override double WeeksInOneSecond => 1.653439153439153e-6; - protected override double YearsInOneSecond => 3.1689e-8; + protected override double YearsInOneSecond => 3.170979198376458e-8; - protected override double Years365InOneSecond => 3.170979198376e-8; + protected override double Years365InOneSecond => 3.170979198376458e-8; [Fact] public static void ToTimeSpanShouldThrowExceptionOnValuesLargerThanTimeSpanMax() diff --git a/UnitsNet.Tests/CustomCode/EnergyTests.cs b/UnitsNet.Tests/CustomCode/EnergyTests.cs index a862bd2d4b..67be4cccfe 100644 --- a/UnitsNet.Tests/CustomCode/EnergyTests.cs +++ b/UnitsNet.Tests/CustomCode/EnergyTests.cs @@ -24,7 +24,7 @@ namespace UnitsNet.Tests.CustomCode public class EnergyTests : EnergyTestsBase { // TODO Override properties in base class here - protected override double ThermsImperialInOneJoule => 9.478171203551087813109937767482e-15; + protected override double ThermsImperialInOneJoule => 9.4369e-9; protected override double JoulesInOneJoule => 1; @@ -40,11 +40,11 @@ public class EnergyTests : EnergyTestsBase protected override double CaloriesInOneJoule => 0.239005736; - protected override double DecathermsEcInOneJoule => 9.47816988e-10; + protected override double DecathermsEcInOneJoule => 9.478171203133172e-10; - protected override double DecathermsImperialInOneJoule => 9.478171203551087813109937767482e-15; + protected override double DecathermsImperialInOneJoule => 9.4369e-10; - protected override double DecathermsUsInOneJoule => 9.4804342797334860315281322406817e-10; + protected override double DecathermsUsInOneJoule => 9.480434279733486e-10; protected override double ElectronVoltsInOneJoule => 6.241509343260179e18; @@ -68,4 +68,4 @@ public class EnergyTests : EnergyTestsBase protected override double WattHoursInOneJoule => 0.000277777778; } -} \ No newline at end of file +} diff --git a/UnitsNet.Tests/CustomCode/ForceTests.cs b/UnitsNet.Tests/CustomCode/ForceTests.cs index 795a569b53..d24909ead7 100644 --- a/UnitsNet.Tests/CustomCode/ForceTests.cs +++ b/UnitsNet.Tests/CustomCode/ForceTests.cs @@ -41,9 +41,9 @@ public class ForceTests : ForceTestsBase protected override double PoundsForceInOneNewton => 0.22481; - protected override double TonnesForceInOneNewton => 1.02e-4; + protected override double TonnesForceInOneNewton => 1.019716212977928e-4; - [Fact] + [ Fact] public void ForceDividedByAreaEqualsPressure() { Pressure pressure = Force.FromNewtons(90)/Area.FromSquareMeters(9); diff --git a/UnitsNet.Tests/CustomCode/IrradiationTests.cs b/UnitsNet.Tests/CustomCode/IrradiationTests.cs index 67fdad388a..555b488d70 100644 --- a/UnitsNet.Tests/CustomCode/IrradiationTests.cs +++ b/UnitsNet.Tests/CustomCode/IrradiationTests.cs @@ -48,8 +48,8 @@ public class IrradiationTests : IrradiationTestsBase { protected override double JoulesPerSquareMeterInOneJoulePerSquareMeter => 1; - protected override double WattHoursPerSquareMeterInOneJoulePerSquareMeter => 2.78E-04; + protected override double WattHoursPerSquareMeterInOneJoulePerSquareMeter => 2.777777777777778e-4; - protected override double KilowattHoursPerSquareMeterInOneJoulePerSquareMeter => 2.78E-07; + protected override double KilowattHoursPerSquareMeterInOneJoulePerSquareMeter => 2.777777777777778e-7; } } diff --git a/UnitsNet.Tests/CustomCode/MassTests.cs b/UnitsNet.Tests/CustomCode/MassTests.cs index a4e16a0bbe..3519707e1e 100644 --- a/UnitsNet.Tests/CustomCode/MassTests.cs +++ b/UnitsNet.Tests/CustomCode/MassTests.cs @@ -42,11 +42,11 @@ public class MassTests : MassTestsBase protected override double KilotonnesInOneKilogram => 1E-6; - protected override double LongTonsInOneKilogram => 0.000984207; + protected override double LongTonsInOneKilogram => 9.842065276110606e-4; protected override double MegapoundsInOneKilogram => 2.2046226218487757e-6; - protected override double MegatonnesInOneKilogram => 1E-6; + protected override double MegatonnesInOneKilogram => 1E-9; protected override double MicrogramsInOneKilogram => 1E9; @@ -60,7 +60,7 @@ public class MassTests : MassTestsBase protected override double PoundsInOneKilogram => 2.2046226218487757d; - protected override double ShortTonsInOneKilogram => 0.00110231; + protected override double ShortTonsInOneKilogram => 1.102311310924388e-3; protected override double StoneInOneKilogram => 0.1574731728702698; @@ -105,4 +105,4 @@ public void MassTimesAccelerationEqualsForce() Assert.Equal(force, Force.FromNewtons(54)); } } -} \ No newline at end of file +} diff --git a/UnitsNet.Tests/CustomCode/PressureTests.cs b/UnitsNet.Tests/CustomCode/PressureTests.cs index 38895a5919..bf6b3d4bd2 100644 --- a/UnitsNet.Tests/CustomCode/PressureTests.cs +++ b/UnitsNet.Tests/CustomCode/PressureTests.cs @@ -30,11 +30,11 @@ public class PressureTests : PressureTestsBase protected override double BarsInOnePascal => 1E-5; - protected override double KilogramsForcePerSquareCentimeterInOnePascal => 0.101971621e-5; + protected override double KilogramsForcePerSquareCentimeterInOnePascal => 1.019716212977928e-5; protected override double KilogramsForcePerSquareMeterInOnePascal => 0.101971621; - protected override double KilogramsForcePerSquareMillimeterInOnePascal => 0.101971621e-7; + protected override double KilogramsForcePerSquareMillimeterInOnePascal => 1.019716212977928e-7; protected override double KilonewtonsPerSquareCentimeterInOnePascal => 1e-7; @@ -44,9 +44,9 @@ public class PressureTests : PressureTestsBase protected override double KilopascalsInOnePascal => 1e-3; - protected override double KilopoundsForcePerSquareFootInOnePascal => 2.089e-5; + protected override double KilopoundsForcePerSquareFootInOnePascal => 2.088543423315013e-5; - protected override double KilopoundsForcePerSquareInchInOnePascal => 1.45e-7; + protected override double KilopoundsForcePerSquareInchInOnePascal => 1.450377377302092e-7; protected override double MegapascalsInOnePascal => 1E-6; @@ -64,17 +64,17 @@ public class PressureTests : PressureTestsBase protected override double PoundsForcePerSquareFootInOnePascal => 0.0208854342; - protected override double PoundsForcePerSquareInchInOnePascal => 0.000145037737730209; + protected override double PoundsForcePerSquareInchInOnePascal => 1.450377377302092e-4; - protected override double PsiInOnePascal => 1.450377*1E-4; + protected override double PsiInOnePascal => 1.450377377302092e-4; protected override double TechnicalAtmospheresInOnePascal => 1.0197*1E-5; - protected override double TonnesForcePerSquareCentimeterInOnePascal => 1e-8; + protected override double TonnesForcePerSquareCentimeterInOnePascal => 1.019716212977928e-8; - protected override double TonnesForcePerSquareMeterInOnePascal => 1e-4; + protected override double TonnesForcePerSquareMeterInOnePascal => 1.019716212977928e-4; - protected override double TonnesForcePerSquareMillimeterInOnePascal => 1e-10; + protected override double TonnesForcePerSquareMillimeterInOnePascal => 1.019716212977928e-10; protected override double TorrsInOnePascal => 7.5006*1E-3; diff --git a/UnitsNet.Tests/CustomCode/SpecificWeightTests.cs b/UnitsNet.Tests/CustomCode/SpecificWeightTests.cs index e9c355aa98..d5267b2026 100644 --- a/UnitsNet.Tests/CustomCode/SpecificWeightTests.cs +++ b/UnitsNet.Tests/CustomCode/SpecificWeightTests.cs @@ -25,11 +25,11 @@ namespace UnitsNet.Tests.CustomCode { public class SpecificWeightTests : SpecificWeightTestsBase { - protected override double KilogramsForcePerCubicCentimeterInOneNewtonPerCubicMeter => 0.101971621e-7; + protected override double KilogramsForcePerCubicCentimeterInOneNewtonPerCubicMeter => 1.019716212977928e-7; protected override double KilogramsForcePerCubicMeterInOneNewtonPerCubicMeter => 0.101971621; - protected override double KilogramsForcePerCubicMillimeterInOneNewtonPerCubicMeter => 0.101971621e-10; + protected override double KilogramsForcePerCubicMillimeterInOneNewtonPerCubicMeter => 1.019716212977928e-10; protected override double KilonewtonsPerCubicCentimeterInOneNewtonPerCubicMeter => 1e-9; @@ -37,9 +37,9 @@ public class SpecificWeightTests : SpecificWeightTestsBase protected override double KilonewtonsPerCubicMillimeterInOneNewtonPerCubicMeter => 1e-12; - protected override double KilopoundsForcePerCubicFootInOneNewtonPerCubicMeter => 6.366e-6; + protected override double KilopoundsForcePerCubicFootInOneNewtonPerCubicMeter => 6.365880354264159e-6; - protected override double KilopoundsForcePerCubicInchInOneNewtonPerCubicMeter => 3.684e-9; + protected override double KilopoundsForcePerCubicInchInOneNewtonPerCubicMeter => 3.683958538347314e-9; protected override double NewtonsPerCubicCentimeterInOneNewtonPerCubicMeter => 1e-6; @@ -47,15 +47,15 @@ public class SpecificWeightTests : SpecificWeightTestsBase protected override double NewtonsPerCubicMillimeterInOneNewtonPerCubicMeter => 1e-9; - protected override double PoundsForcePerCubicFootInOneNewtonPerCubicMeter => 0.006366; + protected override double PoundsForcePerCubicFootInOneNewtonPerCubicMeter => 6.365880354264159e-3; - protected override double PoundsForcePerCubicInchInOneNewtonPerCubicMeter => 3.684e-6; + protected override double PoundsForcePerCubicInchInOneNewtonPerCubicMeter => 3.683958538347314e-6; - protected override double TonnesForcePerCubicCentimeterInOneNewtonPerCubicMeter => 1.02e-13; + protected override double TonnesForcePerCubicCentimeterInOneNewtonPerCubicMeter => 1.019716212977928e-10; - protected override double TonnesForcePerCubicMeterInOneNewtonPerCubicMeter => 1.02e-4; + protected override double TonnesForcePerCubicMeterInOneNewtonPerCubicMeter => 1.019716212977928e-4; - protected override double TonnesForcePerCubicMillimeterInOneNewtonPerCubicMeter => 1.02e-10; + protected override double TonnesForcePerCubicMillimeterInOneNewtonPerCubicMeter => 1.019716212977928e-13; protected override double MeganewtonsPerCubicMeterInOneNewtonPerCubicMeter => 1e-6; diff --git a/UnitsNet.Tests/CustomCode/TorqueTests.cs b/UnitsNet.Tests/CustomCode/TorqueTests.cs index 2c78af380a..43e0ee3d15 100644 --- a/UnitsNet.Tests/CustomCode/TorqueTests.cs +++ b/UnitsNet.Tests/CustomCode/TorqueTests.cs @@ -43,13 +43,13 @@ public class TorqueTests : TorqueTestsBase protected override double KilonewtonMillimetersInOneNewtonMeter => 1; - protected override double MegapoundForceFeetInOneNewtonMeter => 7.376e-7; + protected override double MegapoundForceFeetInOneNewtonMeter => 7.375621492772654e-7; - protected override double KilopoundForceFeetInOneNewtonMeter => 7.376e-4; + protected override double KilopoundForceFeetInOneNewtonMeter => 7.375621492772654e-4; - protected override double MegapoundForceInchesInOneNewtonMeter => 8.8516E-6; + protected override double MegapoundForceInchesInOneNewtonMeter => 8.850745791327184e-6; - protected override double KilopoundForceInchesInOneNewtonMeter => 8.8516E-3; + protected override double KilopoundForceInchesInOneNewtonMeter => 8.850745791327184e-3; protected override double NewtonCentimetersInOneNewtonMeter => 100; @@ -81,4 +81,4 @@ public void TorqueDividedByLengthEqualsForce() Assert.Equal(force, Force.FromNewtons(2)); } } -} \ No newline at end of file +} diff --git a/UnitsNet.Tests/CustomCode/VolumeTests.cs b/UnitsNet.Tests/CustomCode/VolumeTests.cs index d5beabaf48..649c0e2ca1 100644 --- a/UnitsNet.Tests/CustomCode/VolumeTests.cs +++ b/UnitsNet.Tests/CustomCode/VolumeTests.cs @@ -40,7 +40,7 @@ public class VolumeTests : VolumeTestsBase protected override double CubicMetersInOneCubicMeter => 1; - protected override double CubicMilesInOneCubicMeter => 3.86102*1E-7; + protected override double CubicMilesInOneCubicMeter => 2.399127585789277e-10; protected override double CubicMillimetersInOneCubicMeter => 1E9; diff --git a/UnitsNet/GeneratedCode/Quantities/Energy.g.cs b/UnitsNet/GeneratedCode/Quantities/Energy.g.cs index 7a2cabb70e..2b6c266082 100644 --- a/UnitsNet/GeneratedCode/Quantities/Energy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Energy.g.cs @@ -1145,9 +1145,9 @@ public double As(EnergyUnit unit) { case EnergyUnit.BritishThermalUnit: return baseUnitValue/1055.05585262; case EnergyUnit.Calorie: return baseUnitValue/4.184; - case EnergyUnit.DecathermEc: return (baseUnitValue/105505585.262) / 1e1d; - case EnergyUnit.DecathermImperial: return (baseUnitValue/1.05505585257348e+14) / 1e1d; - case EnergyUnit.DecathermUs: return (baseUnitValue/1.054804e+8) / 1e1d; + case EnergyUnit.DecathermEc: return (baseUnitValue/1.05505585262e8) / 1e1d; + case EnergyUnit.DecathermImperial: return (baseUnitValue/1.05967e8) / 1e1d; + case EnergyUnit.DecathermUs: return (baseUnitValue/1.054804e8) / 1e1d; case EnergyUnit.ElectronVolt: return baseUnitValue/1.602176565e-19; case EnergyUnit.Erg: return baseUnitValue/1e-7; case EnergyUnit.FootPound: return baseUnitValue/1.355817948; @@ -1161,9 +1161,9 @@ public double As(EnergyUnit unit) case EnergyUnit.MegabritishThermalUnit: return (baseUnitValue/1055.05585262) / 1e6d; case EnergyUnit.Megajoule: return (baseUnitValue) / 1e6d; case EnergyUnit.MegawattHour: return (baseUnitValue/3600d) / 1e6d; - case EnergyUnit.ThermEc: return baseUnitValue/105505585.262; - case EnergyUnit.ThermImperial: return baseUnitValue/1.05505585257348e+14; - case EnergyUnit.ThermUs: return baseUnitValue/1.054804e+8; + case EnergyUnit.ThermEc: return baseUnitValue/1.05505585262e8; + case EnergyUnit.ThermImperial: return baseUnitValue/1.05967e8; + case EnergyUnit.ThermUs: return baseUnitValue/1.054804e8; case EnergyUnit.WattHour: return baseUnitValue/3600d; default: @@ -1530,9 +1530,9 @@ private double AsBaseUnitJoules() { case EnergyUnit.BritishThermalUnit: return _value*1055.05585262; case EnergyUnit.Calorie: return _value*4.184; - case EnergyUnit.DecathermEc: return (_value*105505585.262) * 1e1d; - case EnergyUnit.DecathermImperial: return (_value*1.05505585257348e+14) * 1e1d; - case EnergyUnit.DecathermUs: return (_value*1.054804e+8) * 1e1d; + case EnergyUnit.DecathermEc: return (_value*1.05505585262e8) * 1e1d; + case EnergyUnit.DecathermImperial: return (_value*1.05967e8) * 1e1d; + case EnergyUnit.DecathermUs: return (_value*1.054804e8) * 1e1d; case EnergyUnit.ElectronVolt: return _value*1.602176565e-19; case EnergyUnit.Erg: return _value*1e-7; case EnergyUnit.FootPound: return _value*1.355817948; @@ -1546,9 +1546,9 @@ private double AsBaseUnitJoules() case EnergyUnit.MegabritishThermalUnit: return (_value*1055.05585262) * 1e6d; case EnergyUnit.Megajoule: return (_value) * 1e6d; case EnergyUnit.MegawattHour: return (_value*3600d) * 1e6d; - case EnergyUnit.ThermEc: return _value*105505585.262; - case EnergyUnit.ThermImperial: return _value*1.05505585257348e+14; - case EnergyUnit.ThermUs: return _value*1.054804e+8; + case EnergyUnit.ThermEc: return _value*1.05505585262e8; + case EnergyUnit.ThermImperial: return _value*1.05967e8; + case EnergyUnit.ThermUs: return _value*1.054804e8; case EnergyUnit.WattHour: return _value*3600d; default: throw new NotImplementedException("Unit not implemented: " + Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/Force.g.cs b/UnitsNet/GeneratedCode/Quantities/Force.g.cs index b634a747eb..cc22a1297e 100644 --- a/UnitsNet/GeneratedCode/Quantities/Force.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Force.g.cs @@ -756,7 +756,7 @@ public double As(ForceUnit unit) case ForceUnit.Newton: return baseUnitValue; case ForceUnit.Poundal: return baseUnitValue/0.13825502798973041652092282466083; case ForceUnit.PoundForce: return baseUnitValue/4.4482216152605095551842641431421; - case ForceUnit.TonneForce: return baseUnitValue/9.80665002864/1000; + case ForceUnit.TonneForce: return baseUnitValue/9.80665002864e3; default: throw new NotImplementedException("unit: " + unit); @@ -1129,7 +1129,7 @@ private double AsBaseUnitNewtons() case ForceUnit.Newton: return _value; case ForceUnit.Poundal: return _value*0.13825502798973041652092282466083; case ForceUnit.PoundForce: return _value*4.4482216152605095551842641431421; - case ForceUnit.TonneForce: return _value*9.80665002864*1000; + case ForceUnit.TonneForce: return _value*9.80665002864e3; default: throw new NotImplementedException("Unit not implemented: " + Unit); } diff --git a/UnitsNet/GeneratedCode/Quantities/Mass.g.cs b/UnitsNet/GeneratedCode/Quantities/Mass.g.cs index ca59a5f3e4..ff60bb4ae4 100644 --- a/UnitsNet/GeneratedCode/Quantities/Mass.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Mass.g.cs @@ -1119,7 +1119,7 @@ public double As(MassUnit unit) case MassUnit.Kilopound: return (baseUnitValue/0.45359237) / 1e3d; case MassUnit.Kilotonne: return (baseUnitValue/1e3) / 1e3d; case MassUnit.LongHundredweight: return baseUnitValue*0.01968413055222121; - case MassUnit.LongTon: return baseUnitValue/1016.0469088; + case MassUnit.LongTon: return baseUnitValue/1.0160469088e3; case MassUnit.Megapound: return (baseUnitValue/0.45359237) / 1e6d; case MassUnit.Megatonne: return (baseUnitValue/1e3) / 1e6d; case MassUnit.Microgram: return (baseUnitValue*1e3) / 1e-6d; @@ -1128,7 +1128,7 @@ public double As(MassUnit unit) case MassUnit.Ounce: return baseUnitValue*35.2739619; case MassUnit.Pound: return baseUnitValue/0.45359237; case MassUnit.ShortHundredweight: return baseUnitValue*0.022046226218487758; - case MassUnit.ShortTon: return baseUnitValue/907.18474; + case MassUnit.ShortTon: return baseUnitValue/9.0718474e2; case MassUnit.Stone: return baseUnitValue*0.1574731728702698; case MassUnit.Tonne: return baseUnitValue/1e3; @@ -1503,7 +1503,7 @@ private double AsBaseUnitKilograms() case MassUnit.Kilopound: return (_value*0.45359237) * 1e3d; case MassUnit.Kilotonne: return (_value*1e3) * 1e3d; case MassUnit.LongHundredweight: return _value/0.01968413055222121; - case MassUnit.LongTon: return _value*1016.0469088; + case MassUnit.LongTon: return _value*1.0160469088e3; case MassUnit.Megapound: return (_value*0.45359237) * 1e6d; case MassUnit.Megatonne: return (_value*1e3) * 1e6d; case MassUnit.Microgram: return (_value/1e3) * 1e-6d; @@ -1512,7 +1512,7 @@ private double AsBaseUnitKilograms() case MassUnit.Ounce: return _value/35.2739619; case MassUnit.Pound: return _value*0.45359237; case MassUnit.ShortHundredweight: return _value/0.022046226218487758; - case MassUnit.ShortTon: return _value*907.18474; + case MassUnit.ShortTon: return _value*9.0718474e2; case MassUnit.Stone: return _value/0.1574731728702698; case MassUnit.Tonne: return _value*1e3; default: diff --git a/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs b/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs index 7358028a23..e844b45655 100644 --- a/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs @@ -1682,15 +1682,15 @@ public double As(PressureUnit unit) case PressureUnit.Hectopascal: return (baseUnitValue) / 1e2d; case PressureUnit.InchOfMercury: return baseUnitValue*2.95299830714159e-4; case PressureUnit.Kilobar: return (baseUnitValue/1e5) / 1e3d; - case PressureUnit.KilogramForcePerSquareCentimeter: return baseUnitValue/(9.80665*1e4); + case PressureUnit.KilogramForcePerSquareCentimeter: return baseUnitValue/9.80665e4; case PressureUnit.KilogramForcePerSquareMeter: return baseUnitValue*0.101971619222242; - case PressureUnit.KilogramForcePerSquareMillimeter: return baseUnitValue*1.01971619222242E-07; + case PressureUnit.KilogramForcePerSquareMillimeter: return baseUnitValue/9.80665e6; case PressureUnit.KilonewtonPerSquareCentimeter: return (baseUnitValue/1e4) / 1e3d; case PressureUnit.KilonewtonPerSquareMeter: return (baseUnitValue) / 1e3d; case PressureUnit.KilonewtonPerSquareMillimeter: return (baseUnitValue/1e6) / 1e3d; case PressureUnit.Kilopascal: return (baseUnitValue) / 1e3d; - case PressureUnit.KilopoundForcePerSquareFoot: return (baseUnitValue*0.020885432426709) / 1e3d; - case PressureUnit.KilopoundForcePerSquareInch: return (baseUnitValue*0.000145037737730209) / 1e3d; + case PressureUnit.KilopoundForcePerSquareFoot: return (baseUnitValue/4.788025898033584e1) / 1e3d; + case PressureUnit.KilopoundForcePerSquareInch: return (baseUnitValue/6.894757293168361e3) / 1e3d; case PressureUnit.Megabar: return (baseUnitValue/1e5) / 1e6d; case PressureUnit.MeganewtonPerSquareMeter: return (baseUnitValue) / 1e6d; case PressureUnit.Megapascal: return (baseUnitValue) / 1e6d; @@ -1702,13 +1702,13 @@ public double As(PressureUnit unit) case PressureUnit.NewtonPerSquareMeter: return baseUnitValue; case PressureUnit.NewtonPerSquareMillimeter: return baseUnitValue/1e6; case PressureUnit.Pascal: return baseUnitValue; - case PressureUnit.PoundForcePerSquareFoot: return baseUnitValue*0.020885432426709; - case PressureUnit.PoundForcePerSquareInch: return baseUnitValue*0.000145037737730209; - case PressureUnit.Psi: return baseUnitValue/(6.89464975179*1e3); + case PressureUnit.PoundForcePerSquareFoot: return baseUnitValue/4.788025898033584e1; + case PressureUnit.PoundForcePerSquareInch: return baseUnitValue/6.894757293168361e3; + case PressureUnit.Psi: return baseUnitValue/6.894757293168361e3; case PressureUnit.TechnicalAtmosphere: return baseUnitValue/(9.80680592331*1e4); - case PressureUnit.TonneForcePerSquareCentimeter: return baseUnitValue*1.01971619222242E-08; - case PressureUnit.TonneForcePerSquareMeter: return baseUnitValue*0.000101971619222242; - case PressureUnit.TonneForcePerSquareMillimeter: return baseUnitValue*1.01971619222242E-10; + case PressureUnit.TonneForcePerSquareCentimeter: return baseUnitValue/9.80665e7; + case PressureUnit.TonneForcePerSquareMeter: return baseUnitValue/9.80665e3; + case PressureUnit.TonneForcePerSquareMillimeter: return baseUnitValue/9.80665e9; case PressureUnit.Torr: return baseUnitValue/(1.3332266752*1e2); default: @@ -2083,15 +2083,15 @@ private double AsBaseUnitPascals() case PressureUnit.Hectopascal: return (_value) * 1e2d; case PressureUnit.InchOfMercury: return _value/2.95299830714159e-4; case PressureUnit.Kilobar: return (_value*1e5) * 1e3d; - case PressureUnit.KilogramForcePerSquareCentimeter: return _value*9.80665*1e4; + case PressureUnit.KilogramForcePerSquareCentimeter: return _value*9.80665e4; case PressureUnit.KilogramForcePerSquareMeter: return _value*9.80665019960652; - case PressureUnit.KilogramForcePerSquareMillimeter: return _value*9806650.19960652; + case PressureUnit.KilogramForcePerSquareMillimeter: return _value*9.80665e6; case PressureUnit.KilonewtonPerSquareCentimeter: return (_value*1e4) * 1e3d; case PressureUnit.KilonewtonPerSquareMeter: return (_value) * 1e3d; case PressureUnit.KilonewtonPerSquareMillimeter: return (_value*1e6) * 1e3d; case PressureUnit.Kilopascal: return (_value) * 1e3d; - case PressureUnit.KilopoundForcePerSquareFoot: return (_value*47.8802631216372) * 1e3d; - case PressureUnit.KilopoundForcePerSquareInch: return (_value*6894.75729316836) * 1e3d; + case PressureUnit.KilopoundForcePerSquareFoot: return (_value*4.788025898033584e1) * 1e3d; + case PressureUnit.KilopoundForcePerSquareInch: return (_value*6.894757293168361e3) * 1e3d; case PressureUnit.Megabar: return (_value*1e5) * 1e6d; case PressureUnit.MeganewtonPerSquareMeter: return (_value) * 1e6d; case PressureUnit.Megapascal: return (_value) * 1e6d; @@ -2103,13 +2103,13 @@ private double AsBaseUnitPascals() case PressureUnit.NewtonPerSquareMeter: return _value; case PressureUnit.NewtonPerSquareMillimeter: return _value*1e6; case PressureUnit.Pascal: return _value; - case PressureUnit.PoundForcePerSquareFoot: return _value*47.8802631216372; - case PressureUnit.PoundForcePerSquareInch: return _value*6894.75729316836; - case PressureUnit.Psi: return _value*6.89464975179*1e3; + case PressureUnit.PoundForcePerSquareFoot: return _value*4.788025898033584e1; + case PressureUnit.PoundForcePerSquareInch: return _value*6.894757293168361e3; + case PressureUnit.Psi: return _value*6.894757293168361e3; case PressureUnit.TechnicalAtmosphere: return _value*9.80680592331*1e4; - case PressureUnit.TonneForcePerSquareCentimeter: return _value*98066501.9960652; - case PressureUnit.TonneForcePerSquareMeter: return _value*9806.65019960653; - case PressureUnit.TonneForcePerSquareMillimeter: return _value*9806650199.60653; + case PressureUnit.TonneForcePerSquareCentimeter: return _value*9.80665e7; + case PressureUnit.TonneForcePerSquareMeter: return _value*9.80665e3; + case PressureUnit.TonneForcePerSquareMillimeter: return _value*9.80665e9; case PressureUnit.Torr: return _value*1.3332266752*1e2; default: throw new NotImplementedException("Unit not implemented: " + Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs index bae6b93595..3773e56555 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs @@ -978,23 +978,23 @@ public double As(SpecificWeightUnit unit) switch (unit) { - case SpecificWeightUnit.KilogramForcePerCubicCentimeter: return baseUnitValue*1.01971619222242E-07; - case SpecificWeightUnit.KilogramForcePerCubicMeter: return baseUnitValue*0.101971619222242; - case SpecificWeightUnit.KilogramForcePerCubicMillimeter: return baseUnitValue*1.01971619222242E-10; + case SpecificWeightUnit.KilogramForcePerCubicCentimeter: return baseUnitValue/9.80665e6; + case SpecificWeightUnit.KilogramForcePerCubicMeter: return baseUnitValue/9.80665; + case SpecificWeightUnit.KilogramForcePerCubicMillimeter: return baseUnitValue/9.80665e9; case SpecificWeightUnit.KilonewtonPerCubicCentimeter: return (baseUnitValue*0.000001) / 1e3d; case SpecificWeightUnit.KilonewtonPerCubicMeter: return (baseUnitValue) / 1e3d; case SpecificWeightUnit.KilonewtonPerCubicMillimeter: return (baseUnitValue*0.000000001) / 1e3d; - case SpecificWeightUnit.KilopoundForcePerCubicFoot: return (baseUnitValue*0.00636587980366089) / 1e3d; - case SpecificWeightUnit.KilopoundForcePerCubicInch: return (baseUnitValue*3.68395821971116E-06) / 1e3d; + case SpecificWeightUnit.KilopoundForcePerCubicFoot: return (baseUnitValue/1.570874638462462e2) / 1e3d; + case SpecificWeightUnit.KilopoundForcePerCubicInch: return (baseUnitValue/2.714471375263134e5) / 1e3d; case SpecificWeightUnit.MeganewtonPerCubicMeter: return (baseUnitValue) / 1e6d; case SpecificWeightUnit.NewtonPerCubicCentimeter: return baseUnitValue*0.000001; case SpecificWeightUnit.NewtonPerCubicMeter: return baseUnitValue; case SpecificWeightUnit.NewtonPerCubicMillimeter: return baseUnitValue*0.000000001; - case SpecificWeightUnit.PoundForcePerCubicFoot: return baseUnitValue*0.00636587980366089; - case SpecificWeightUnit.PoundForcePerCubicInch: return baseUnitValue*3.68395821971116E-06; - case SpecificWeightUnit.TonneForcePerCubicCentimeter: return baseUnitValue*1.01971619222242E-10; - case SpecificWeightUnit.TonneForcePerCubicMeter: return baseUnitValue*0.000101971619222242; - case SpecificWeightUnit.TonneForcePerCubicMillimeter: return baseUnitValue*1.01971619222242E-13; + case SpecificWeightUnit.PoundForcePerCubicFoot: return baseUnitValue/1.570874638462462e2; + case SpecificWeightUnit.PoundForcePerCubicInch: return baseUnitValue/2.714471375263134e5; + case SpecificWeightUnit.TonneForcePerCubicCentimeter: return baseUnitValue/9.80665e9; + case SpecificWeightUnit.TonneForcePerCubicMeter: return baseUnitValue/9.80665e3; + case SpecificWeightUnit.TonneForcePerCubicMillimeter: return baseUnitValue/9.80665e12; default: throw new NotImplementedException("unit: " + unit); @@ -1358,23 +1358,23 @@ private double AsBaseUnitNewtonsPerCubicMeter() switch (Unit) { - case SpecificWeightUnit.KilogramForcePerCubicCentimeter: return _value*9806650.19960652; - case SpecificWeightUnit.KilogramForcePerCubicMeter: return _value*9.80665019960652; - case SpecificWeightUnit.KilogramForcePerCubicMillimeter: return _value*9806650199.60653; + case SpecificWeightUnit.KilogramForcePerCubicCentimeter: return _value*9.80665e6; + case SpecificWeightUnit.KilogramForcePerCubicMeter: return _value*9.80665; + case SpecificWeightUnit.KilogramForcePerCubicMillimeter: return _value*9.80665e9; case SpecificWeightUnit.KilonewtonPerCubicCentimeter: return (_value*1000000) * 1e3d; case SpecificWeightUnit.KilonewtonPerCubicMeter: return (_value) * 1e3d; case SpecificWeightUnit.KilonewtonPerCubicMillimeter: return (_value*1000000000) * 1e3d; - case SpecificWeightUnit.KilopoundForcePerCubicFoot: return (_value*157.087477433193) * 1e3d; - case SpecificWeightUnit.KilopoundForcePerCubicInch: return (_value*271447.161004558) * 1e3d; + case SpecificWeightUnit.KilopoundForcePerCubicFoot: return (_value*1.570874638462462e2) * 1e3d; + case SpecificWeightUnit.KilopoundForcePerCubicInch: return (_value*2.714471375263134e5) * 1e3d; case SpecificWeightUnit.MeganewtonPerCubicMeter: return (_value) * 1e6d; case SpecificWeightUnit.NewtonPerCubicCentimeter: return _value*1000000; case SpecificWeightUnit.NewtonPerCubicMeter: return _value; case SpecificWeightUnit.NewtonPerCubicMillimeter: return _value*1000000000; - case SpecificWeightUnit.PoundForcePerCubicFoot: return _value*157.087477433193; - case SpecificWeightUnit.PoundForcePerCubicInch: return _value*271447.161004558; - case SpecificWeightUnit.TonneForcePerCubicCentimeter: return _value*9806650199.60653; - case SpecificWeightUnit.TonneForcePerCubicMeter: return _value*9806.65019960653; - case SpecificWeightUnit.TonneForcePerCubicMillimeter: return _value*9806650199606.53; + case SpecificWeightUnit.PoundForcePerCubicFoot: return _value*1.570874638462462e2; + case SpecificWeightUnit.PoundForcePerCubicInch: return _value*2.714471375263134e5; + case SpecificWeightUnit.TonneForcePerCubicCentimeter: return _value*9.80665e9; + case SpecificWeightUnit.TonneForcePerCubicMeter: return _value*9.80665e3; + case SpecificWeightUnit.TonneForcePerCubicMillimeter: return _value*9.80665e12; default: throw new NotImplementedException("Unit not implemented: " + Unit); } diff --git a/UnitsNet/GeneratedCode/Quantities/Torque.g.cs b/UnitsNet/GeneratedCode/Quantities/Torque.g.cs index 43abbe735c..1a30d85300 100644 --- a/UnitsNet/GeneratedCode/Quantities/Torque.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Torque.g.cs @@ -1116,18 +1116,18 @@ public double As(TorqueUnit unit) case TorqueUnit.KilonewtonCentimeter: return (baseUnitValue*100) / 1e3d; case TorqueUnit.KilonewtonMeter: return (baseUnitValue) / 1e3d; case TorqueUnit.KilonewtonMillimeter: return (baseUnitValue*1000) / 1e3d; - case TorqueUnit.KilopoundForceFoot: return (baseUnitValue*0.737562085483396) / 1e3d; - case TorqueUnit.KilopoundForceInch: return (baseUnitValue*8.85074502580075) / 1e3d; + case TorqueUnit.KilopoundForceFoot: return (baseUnitValue/1.3558179483314) / 1e3d; + case TorqueUnit.KilopoundForceInch: return (baseUnitValue/1.129848290276167e-1) / 1e3d; case TorqueUnit.MeganewtonCentimeter: return (baseUnitValue*100) / 1e6d; case TorqueUnit.MeganewtonMeter: return (baseUnitValue) / 1e6d; case TorqueUnit.MeganewtonMillimeter: return (baseUnitValue*1000) / 1e6d; - case TorqueUnit.MegapoundForceFoot: return (baseUnitValue*0.737562085483396) / 1e6d; - case TorqueUnit.MegapoundForceInch: return (baseUnitValue*8.85074502580075) / 1e6d; + case TorqueUnit.MegapoundForceFoot: return (baseUnitValue/1.3558179483314) / 1e6d; + case TorqueUnit.MegapoundForceInch: return (baseUnitValue/1.129848290276167e-1) / 1e6d; case TorqueUnit.NewtonCentimeter: return baseUnitValue*100; case TorqueUnit.NewtonMeter: return baseUnitValue; case TorqueUnit.NewtonMillimeter: return baseUnitValue*1000; - case TorqueUnit.PoundForceFoot: return baseUnitValue*0.737562085483396; - case TorqueUnit.PoundForceInch: return baseUnitValue*8.85074502580075; + case TorqueUnit.PoundForceFoot: return baseUnitValue/1.3558179483314; + case TorqueUnit.PoundForceInch: return baseUnitValue/1.129848290276167e-1; case TorqueUnit.TonneForceCentimeter: return baseUnitValue*0.0101971619222242; case TorqueUnit.TonneForceMeter: return baseUnitValue*0.000101971619222242; case TorqueUnit.TonneForceMillimeter: return baseUnitValue*0.101971619222242; @@ -1500,18 +1500,18 @@ private double AsBaseUnitNewtonMeters() case TorqueUnit.KilonewtonCentimeter: return (_value*0.01) * 1e3d; case TorqueUnit.KilonewtonMeter: return (_value) * 1e3d; case TorqueUnit.KilonewtonMillimeter: return (_value*0.001) * 1e3d; - case TorqueUnit.KilopoundForceFoot: return (_value*1.3558180656) * 1e3d; - case TorqueUnit.KilopoundForceInch: return (_value*0.1129848388) * 1e3d; + case TorqueUnit.KilopoundForceFoot: return (_value*1.3558179483314) * 1e3d; + case TorqueUnit.KilopoundForceInch: return (_value*1.129848290276167e-1) * 1e3d; case TorqueUnit.MeganewtonCentimeter: return (_value*0.01) * 1e6d; case TorqueUnit.MeganewtonMeter: return (_value) * 1e6d; case TorqueUnit.MeganewtonMillimeter: return (_value*0.001) * 1e6d; - case TorqueUnit.MegapoundForceFoot: return (_value*1.3558180656) * 1e6d; - case TorqueUnit.MegapoundForceInch: return (_value*0.1129848388) * 1e6d; + case TorqueUnit.MegapoundForceFoot: return (_value*1.3558179483314) * 1e6d; + case TorqueUnit.MegapoundForceInch: return (_value*1.129848290276167e-1) * 1e6d; case TorqueUnit.NewtonCentimeter: return _value*0.01; case TorqueUnit.NewtonMeter: return _value; case TorqueUnit.NewtonMillimeter: return _value*0.001; - case TorqueUnit.PoundForceFoot: return _value*1.3558180656; - case TorqueUnit.PoundForceInch: return _value*0.1129848388; + case TorqueUnit.PoundForceFoot: return _value*1.3558179483314; + case TorqueUnit.PoundForceInch: return _value*1.129848290276167e-1; case TorqueUnit.TonneForceCentimeter: return _value*98.0665019960652; case TorqueUnit.TonneForceMeter: return _value*9806.65019960653; case TorqueUnit.TonneForceMillimeter: return _value*9.80665019960652; diff --git a/UnitsNet/GeneratedCode/Quantities/Volume.g.cs b/UnitsNet/GeneratedCode/Quantities/Volume.g.cs index 2c3fd4ce57..9b485467f5 100644 --- a/UnitsNet/GeneratedCode/Quantities/Volume.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Volume.g.cs @@ -1880,7 +1880,7 @@ public double As(VolumeUnit unit) case VolumeUnit.CubicKilometer: return baseUnitValue/1e9; case VolumeUnit.CubicMeter: return baseUnitValue; case VolumeUnit.CubicMicrometer: return baseUnitValue*1e18; - case VolumeUnit.CubicMile: return baseUnitValue/(4.16818183*1e9); + case VolumeUnit.CubicMile: return baseUnitValue/4.16818182544058e9; case VolumeUnit.CubicMillimeter: return baseUnitValue*1e9; case VolumeUnit.CubicYard: return baseUnitValue/0.764554858; case VolumeUnit.Deciliter: return (baseUnitValue*1e3) / 1e-1d; @@ -2287,7 +2287,7 @@ private double AsBaseUnitCubicMeters() case VolumeUnit.CubicKilometer: return _value*1e9; case VolumeUnit.CubicMeter: return _value; case VolumeUnit.CubicMicrometer: return _value/1e18; - case VolumeUnit.CubicMile: return _value*4.16818183*1e9; + case VolumeUnit.CubicMile: return _value*4.16818182544058e9; case VolumeUnit.CubicMillimeter: return _value/1e9; case VolumeUnit.CubicYard: return _value*0.764554858; case VolumeUnit.Deciliter: return (_value/1e3) * 1e-1d; diff --git a/UnitsNet/UnitDefinitions/Energy.json b/UnitsNet/UnitDefinitions/Energy.json index cd5b3b2be6..160a987296 100644 --- a/UnitsNet/UnitDefinitions/Energy.json +++ b/UnitsNet/UnitDefinitions/Energy.json @@ -98,8 +98,8 @@ { "SingularName": "ThermEc", "PluralName": "ThermsEc", - "FromUnitToBaseFunc": "x*105505585.262", - "FromBaseToUnitFunc": "x/105505585.262", + "FromUnitToBaseFunc": "x*1.05505585262e8", + "FromBaseToUnitFunc": "x/1.05505585262e8", "Prefixes": [ "Deca" ], "Localization": [ { @@ -117,8 +117,8 @@ { "SingularName": "ThermUs", "PluralName": "ThermsUs", - "FromUnitToBaseFunc": "x*1.054804e+8", - "FromBaseToUnitFunc": "x/1.054804e+8", + "FromUnitToBaseFunc": "x*1.054804e8", + "FromBaseToUnitFunc": "x/1.054804e8", "Prefixes": [ "Deca" ], "Localization": [ { @@ -136,8 +136,8 @@ { "SingularName": "ThermImperial", "PluralName": "ThermsImperial", - "FromUnitToBaseFunc": "x*1.05505585257348e+14", - "FromBaseToUnitFunc": "x/1.05505585257348e+14", + "FromUnitToBaseFunc": "x*1.05967e8", + "FromBaseToUnitFunc": "x/1.05967e8", "Prefixes": [ "Deca" ], "Localization": [ { diff --git a/UnitsNet/UnitDefinitions/Force.json b/UnitsNet/UnitDefinitions/Force.json index 99b3b7b01a..92d149e063 100644 --- a/UnitsNet/UnitDefinitions/Force.json +++ b/UnitsNet/UnitDefinitions/Force.json @@ -38,8 +38,8 @@ { "SingularName": "TonneForce", "PluralName": "TonnesForce", - "FromUnitToBaseFunc": "x*9.80665002864*1000", - "FromBaseToUnitFunc": "x/9.80665002864/1000", + "FromUnitToBaseFunc": "x*9.80665002864e3", + "FromBaseToUnitFunc": "x/9.80665002864e3", "Localization": [ { "Culture": "en-US", diff --git a/UnitsNet/UnitDefinitions/Mass.json b/UnitsNet/UnitDefinitions/Mass.json index 7658ea80b9..921efd12b0 100644 --- a/UnitsNet/UnitDefinitions/Mass.json +++ b/UnitsNet/UnitDefinitions/Mass.json @@ -42,8 +42,8 @@ { "SingularName": "ShortTon", "PluralName": "ShortTons", - "FromUnitToBaseFunc": "x*907.18474", - "FromBaseToUnitFunc": "x/907.18474", + "FromUnitToBaseFunc": "x*9.0718474e2", + "FromBaseToUnitFunc": "x/9.0718474e2", "XmlDocSummary": "The short ton is a unit of mass equal to 2,000 pounds (907.18474 kg), that is most commonly used in the United States – known there simply as the ton.", "XmlDocRemarks": "http://en.wikipedia.org/wiki/Short_ton", "Localization": [ @@ -60,8 +60,8 @@ { "SingularName": "LongTon", "PluralName": "LongTons", - "FromUnitToBaseFunc": "x*1016.0469088", - "FromBaseToUnitFunc": "x/1016.0469088", + "FromUnitToBaseFunc": "x*1.0160469088e3", + "FromBaseToUnitFunc": "x/1.0160469088e3", "XmlDocSummary": "Long ton (weight ton or Imperial ton) is a unit of mass equal to 2,240 pounds (1,016 kg) and is the name for the unit called the \"ton\" in the avoirdupois or Imperial system of measurements that was used in the United Kingdom and several other Commonwealth countries before metrication.", "XmlDocRemarks": "http://en.wikipedia.org/wiki/Long_ton", "Localization": [ diff --git a/UnitsNet/UnitDefinitions/Pressure.json b/UnitsNet/UnitDefinitions/Pressure.json index b57158074e..d05b59c31a 100644 --- a/UnitsNet/UnitDefinitions/Pressure.json +++ b/UnitsNet/UnitDefinitions/Pressure.json @@ -73,8 +73,8 @@ { "SingularName": "KilogramForcePerSquareCentimeter", "PluralName": "KilogramsForcePerSquareCentimeter", - "FromUnitToBaseFunc": "x*9.80665*1e4", - "FromBaseToUnitFunc": "x/(9.80665*1e4)", + "FromUnitToBaseFunc": "x*9.80665e4", + "FromBaseToUnitFunc": "x/9.80665e4", "Localization": [ { "Culture": "en-US", @@ -89,8 +89,8 @@ { "SingularName": "KilogramForcePerSquareMillimeter", "PluralName": "KilogramsForcePerSquareMillimeter", - "FromUnitToBaseFunc": "x*9806650.19960652", - "FromBaseToUnitFunc": "x*1.01971619222242E-07", + "FromUnitToBaseFunc": "x*9.80665e6", + "FromBaseToUnitFunc": "x/9.80665e6", "Localization": [ { "Culture": "en-US", @@ -160,8 +160,8 @@ "SingularName": "Psi", "PluralName": "Psi", "ObsoleteText": "Deprecated due to github issue #215, please use PoundForcePerSquareInch instead", - "FromUnitToBaseFunc": "x*6.89464975179*1e3", - "FromBaseToUnitFunc": "x/(6.89464975179*1e3)", + "FromUnitToBaseFunc": "x*6.894757293168361e3", + "FromBaseToUnitFunc": "x/6.894757293168361e3", "Localization": [ { "Culture": "en-US", @@ -208,8 +208,8 @@ { "SingularName": "PoundForcePerSquareInch", "PluralName": "PoundsForcePerSquareInch", - "FromUnitToBaseFunc": "x*6894.75729316836", - "FromBaseToUnitFunc": "x*0.000145037737730209", + "FromUnitToBaseFunc": "x*6.894757293168361e3", + "FromBaseToUnitFunc": "x/6.894757293168361e3", "Prefixes": [ "Kilo" ], "Localization": [ { @@ -222,8 +222,8 @@ { "SingularName": "PoundForcePerSquareFoot", "PluralName": "PoundsForcePerSquareFoot", - "FromUnitToBaseFunc": "x*47.8802631216372", - "FromBaseToUnitFunc": "x*0.020885432426709", + "FromUnitToBaseFunc": "x*4.788025898033584e1", + "FromBaseToUnitFunc": "x/4.788025898033584e1", "Prefixes": [ "Kilo" ], "Localization": [ { @@ -236,8 +236,8 @@ { "SingularName": "TonneForcePerSquareMillimeter", "PluralName": "TonnesForcePerSquareMillimeter", - "FromUnitToBaseFunc": "x*9806650199.60653", - "FromBaseToUnitFunc": "x*1.01971619222242E-10", + "FromUnitToBaseFunc": "x*9.80665e9", + "FromBaseToUnitFunc": "x/9.80665e9", "Localization": [ { "Culture": "en-US", @@ -248,8 +248,8 @@ { "SingularName": "TonneForcePerSquareMeter", "PluralName": "TonnesForcePerSquareMeter", - "FromUnitToBaseFunc": "x*9806.65019960653", - "FromBaseToUnitFunc": "x*0.000101971619222242", + "FromUnitToBaseFunc": "x*9.80665e3", + "FromBaseToUnitFunc": "x/9.80665e3", "Localization": [ { "Culture": "en-US", @@ -272,8 +272,8 @@ { "SingularName": "TonneForcePerSquareCentimeter", "PluralName": "TonnesForcePerSquareCentimeter", - "FromUnitToBaseFunc": "x*98066501.9960652", - "FromBaseToUnitFunc": "x*1.01971619222242E-08", + "FromUnitToBaseFunc": "x*9.80665e7", + "FromBaseToUnitFunc": "x/9.80665e7", "Localization": [ { "Culture": "en-US", diff --git a/UnitsNet/UnitDefinitions/SpecificWeight.json b/UnitsNet/UnitDefinitions/SpecificWeight.json index c6efdfbbf2..6f2eb47aae 100644 --- a/UnitsNet/UnitDefinitions/SpecificWeight.json +++ b/UnitsNet/UnitDefinitions/SpecificWeight.json @@ -46,8 +46,8 @@ { "SingularName": "KilogramForcePerCubicMillimeter", "PluralName": "KilogramsForcePerCubicMillimeter", - "FromUnitToBaseFunc": "x*9806650199.60653", - "FromBaseToUnitFunc": "x*1.01971619222242E-10", + "FromUnitToBaseFunc": "x*9.80665e9", + "FromBaseToUnitFunc": "x/9.80665e9", "Localization": [ { "Culture": "en-US", @@ -58,8 +58,8 @@ { "SingularName": "KilogramForcePerCubicCentimeter", "PluralName": "KilogramsForcePerCubicCentimeter", - "FromUnitToBaseFunc": "x*9806650.19960652", - "FromBaseToUnitFunc": "x*1.01971619222242E-07", + "FromUnitToBaseFunc": "x*9.80665e6", + "FromBaseToUnitFunc": "x/9.80665e6", "Localization": [ { "Culture": "en-US", @@ -70,8 +70,8 @@ { "SingularName": "KilogramForcePerCubicMeter", "PluralName": "KilogramsForcePerCubicMeter", - "FromUnitToBaseFunc": "x*9.80665019960652", - "FromBaseToUnitFunc": "x*0.101971619222242", + "FromUnitToBaseFunc": "x*9.80665", + "FromBaseToUnitFunc": "x/9.80665", "Localization": [ { "Culture": "en-US", @@ -82,8 +82,8 @@ { "SingularName": "PoundForcePerCubicInch", "PluralName": "PoundsForcePerCubicInch", - "FromUnitToBaseFunc": "x*271447.161004558", - "FromBaseToUnitFunc": "x*3.68395821971116E-06", + "FromUnitToBaseFunc": "x*2.714471375263134e5", + "FromBaseToUnitFunc": "x/2.714471375263134e5", "Prefixes": [ "Kilo" ], "Localization": [ { @@ -96,8 +96,8 @@ { "SingularName": "PoundForcePerCubicFoot", "PluralName": "PoundsForcePerCubicFoot", - "FromUnitToBaseFunc": "x*157.087477433193", - "FromBaseToUnitFunc": "x*0.00636587980366089", + "FromUnitToBaseFunc": "x*1.570874638462462e2", + "FromBaseToUnitFunc": "x/1.570874638462462e2", "Prefixes": [ "Kilo" ], "Localization": [ { @@ -110,8 +110,8 @@ { "SingularName": "TonneForcePerCubicMillimeter", "PluralName": "TonnesForcePerCubicMillimeter", - "FromUnitToBaseFunc": "x*9806650199606.53", - "FromBaseToUnitFunc": "x*1.01971619222242E-13", + "FromUnitToBaseFunc": "x*9.80665e12", + "FromBaseToUnitFunc": "x/9.80665e12", "Localization": [ { "Culture": "en-US", @@ -122,8 +122,8 @@ { "SingularName": "TonneForcePerCubicCentimeter", "PluralName": "TonnesForcePerCubicCentimeter", - "FromUnitToBaseFunc": "x*9806650199.60653", - "FromBaseToUnitFunc": "x*1.01971619222242E-10", + "FromUnitToBaseFunc": "x*9.80665e9", + "FromBaseToUnitFunc": "x/9.80665e9", "Localization": [ { "Culture": "en-US", @@ -134,8 +134,8 @@ { "SingularName": "TonneForcePerCubicMeter", "PluralName": "TonnesForcePerCubicMeter", - "FromUnitToBaseFunc": "x*9806.65019960653", - "FromBaseToUnitFunc": "x*0.000101971619222242", + "FromUnitToBaseFunc": "x*9.80665e3", + "FromBaseToUnitFunc": "x/9.80665e3", "Localization": [ { "Culture": "en-US", diff --git a/UnitsNet/UnitDefinitions/Torque.json b/UnitsNet/UnitDefinitions/Torque.json index caeb40a7a4..42bd68403a 100644 --- a/UnitsNet/UnitDefinitions/Torque.json +++ b/UnitsNet/UnitDefinitions/Torque.json @@ -50,22 +50,22 @@ { "SingularName": "PoundForceInch", "PluralName": "PoundForceInches", - "FromUnitToBaseFunc": "x*0.1129848388", - "FromBaseToUnitFunc": "x*8.85074502580075", + "FromUnitToBaseFunc": "x*1.129848290276167e-1", + "FromBaseToUnitFunc": "x/1.129848290276167e-1", "Prefixes": [ "Kilo", "Mega" ], "Localization": [ { "Culture": "en-US", "Abbreviations": [ "lbf·in" ], - "AbbreviationsWithPrefixes": [ "kipf·in", "Mlbf·in"] + "AbbreviationsWithPrefixes": [ "kipf·in", "Mlbf·in" ] } ] }, { "SingularName": "PoundForceFoot", "PluralName": "PoundForceFeet", - "FromUnitToBaseFunc": "x*1.3558180656", - "FromBaseToUnitFunc": "x*0.737562085483396", + "FromUnitToBaseFunc": "x*1.3558179483314", + "FromBaseToUnitFunc": "x/1.3558179483314", "Prefixes": [ "Kilo", "Mega" ], "Localization": [ { diff --git a/UnitsNet/UnitDefinitions/Volume.json b/UnitsNet/UnitDefinitions/Volume.json index 2b99cb49e4..368342270d 100644 --- a/UnitsNet/UnitDefinitions/Volume.json +++ b/UnitsNet/UnitDefinitions/Volume.json @@ -121,8 +121,8 @@ { "SingularName": "CubicMile", "PluralName": "CubicMiles", - "FromUnitToBaseFunc": "x*4.16818183*1e9", - "FromBaseToUnitFunc": "x/(4.16818183*1e9)", + "FromUnitToBaseFunc": "x*4.16818182544058e9", + "FromBaseToUnitFunc": "x/4.16818182544058e9", "Localization": [ { "Culture": "en-US", From 877db67e5129b9577e874349e6d9edfe71e9ad4f Mon Sep 17 00:00:00 2001 From: Tristan Milnthorp Date: Thu, 21 Jun 2018 12:42:04 -0400 Subject: [PATCH 03/19] Removing default parameters for windows runtime component --- UnitsNet/Comparison.cs | 8 ++++---- UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Angle.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Area.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs | 2 +- .../GeneratedCode/Quantities/AreaMomentOfInertia.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/BitRate.g.cs | 2 +- .../Quantities/BrakeSpecificFuelConsumption.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Capacitance.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Density.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Duration.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs | 2 +- .../GeneratedCode/Quantities/ElectricChargeDensity.g.cs | 2 +- .../GeneratedCode/Quantities/ElectricConductance.g.cs | 2 +- .../GeneratedCode/Quantities/ElectricConductivity.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs | 2 +- .../GeneratedCode/Quantities/ElectricCurrentDensity.g.cs | 2 +- .../GeneratedCode/Quantities/ElectricCurrentGradient.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs | 2 +- .../GeneratedCode/Quantities/ElectricPotentialAc.g.cs | 2 +- .../GeneratedCode/Quantities/ElectricPotentialDc.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs | 2 +- .../GeneratedCode/Quantities/ElectricResistivity.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Energy.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Entropy.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Flow.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Force.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Frequency.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs | 2 +- .../GeneratedCode/Quantities/HeatTransferCoefficient.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Information.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/LapseRate.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Length.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Level.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/LuminousFlux.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/MagneticField.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/MagneticFlux.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Magnetization.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Mass.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs | 2 +- .../GeneratedCode/Quantities/MassMomentOfInertia.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/MolarEnergy.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/MolarEntropy.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Molarity.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Permeability.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Permittivity.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Power.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/PowerRatio.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Pressure.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Ratio.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/ReactivePower.g.cs | 2 +- .../GeneratedCode/Quantities/RotationalAcceleration.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs | 2 +- .../GeneratedCode/Quantities/RotationalStiffness.g.cs | 2 +- .../Quantities/RotationalStiffnessPerLength.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/SolidAngle.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Speed.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Temperature.g.cs | 2 +- .../GeneratedCode/Quantities/TemperatureChangeRate.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs | 2 +- .../GeneratedCode/Quantities/ThermalConductivity.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/ThermalResistance.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Torque.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/VitaminA.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/Volume.g.cs | 2 +- UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs | 2 +- UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 | 2 +- 92 files changed, 95 insertions(+), 95 deletions(-) diff --git a/UnitsNet/Comparison.cs b/UnitsNet/Comparison.cs index 02975f3728..c2beb777c2 100644 --- a/UnitsNet/Comparison.cs +++ b/UnitsNet/Comparison.cs @@ -23,9 +23,9 @@ namespace UnitsNet { - public class Comparison + public sealed class Comparison { - public static bool Equals( double value1, double value2, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public static bool Equals( double value1, double value2, double tolerance, ComparisonType comparisonType) { if(comparisonType == ComparisonType.Relative) return EqualsRelative(value1, value2, tolerance); @@ -35,13 +35,13 @@ public static bool Equals( double value1, double value2, double tolerance = 0.00 throw new InvalidOperationException("The ComparisonType is unsupported."); } - public static bool EqualsRelative( double value1, double value2, double tolerance = 0.00001) + public static bool EqualsRelative( double value1, double value2, double tolerance) { double maxVariation = Math.Abs( value1 * tolerance ); return Math.Abs( value1 - value2 ) <= maxVariation; } - public static bool EqualsAbsolute( double value1, double value2, double tolerance = 0.00001) + public static bool EqualsAbsolute( double value1, double value2, double tolerance) { return Math.Abs( value1 - value2 ) <= tolerance; } diff --git a/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs b/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs index 185d713d7a..53bce1592e 100644 --- a/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs @@ -801,7 +801,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(Acceleration other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(Acceleration other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitMetersPerSecondSquared(); double otherBaseValue = (double)other.AsBaseUnitMetersPerSecondSquared(); diff --git a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs index 8c5f0d2826..20827f9a18 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs @@ -834,7 +834,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(AmountOfSubstance other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(AmountOfSubstance other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitMoles(); double otherBaseValue = (double)other.AsBaseUnitMoles(); diff --git a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs index a63ca30bb0..962d551d1a 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs @@ -512,7 +512,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(AmplitudeRatio other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(AmplitudeRatio other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitDecibelVolts(); double otherBaseValue = (double)other.AsBaseUnitDecibelVolts(); diff --git a/UnitsNet/GeneratedCode/Quantities/Angle.g.cs b/UnitsNet/GeneratedCode/Quantities/Angle.g.cs index 103a329bd6..29c802d116 100644 --- a/UnitsNet/GeneratedCode/Quantities/Angle.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Angle.g.cs @@ -834,7 +834,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(Angle other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(Angle other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitDegrees(); double otherBaseValue = (double)other.AsBaseUnitDegrees(); diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs index 1468d5c570..0584e51fbd 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs @@ -471,7 +471,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(ApparentEnergy other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(ApparentEnergy other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitVoltampereHours(); double otherBaseValue = (double)other.AsBaseUnitVoltampereHours(); diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs index 22df1a3677..15ce79b6fb 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs @@ -504,7 +504,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(ApparentPower other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(ApparentPower other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitVoltamperes(); double otherBaseValue = (double)other.AsBaseUnitVoltamperes(); diff --git a/UnitsNet/GeneratedCode/Quantities/Area.g.cs b/UnitsNet/GeneratedCode/Quantities/Area.g.cs index 3211190988..57b47d3e87 100644 --- a/UnitsNet/GeneratedCode/Quantities/Area.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Area.g.cs @@ -801,7 +801,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(Area other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(Area other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitSquareMeters(); double otherBaseValue = (double)other.AsBaseUnitSquareMeters(); diff --git a/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs index 60bbd13374..beb2dc5ab5 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs @@ -405,7 +405,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(AreaDensity other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(AreaDensity other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitKilogramsPerSquareMeter(); double otherBaseValue = (double)other.AsBaseUnitKilogramsPerSquareMeter(); diff --git a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs index 20cc3b8117..7b4ea19ae4 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs @@ -570,7 +570,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(AreaMomentOfInertia other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(AreaMomentOfInertia other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitMetersToTheFourth(); double otherBaseValue = (double)other.AsBaseUnitMetersToTheFourth(); diff --git a/UnitsNet/GeneratedCode/Quantities/BitRate.g.cs b/UnitsNet/GeneratedCode/Quantities/BitRate.g.cs index 6a0fc84796..abf77d136b 100644 --- a/UnitsNet/GeneratedCode/Quantities/BitRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BitRate.g.cs @@ -1227,7 +1227,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(BitRate other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(BitRate other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitBitsPerSecond(); double otherBaseValue = (double)other.AsBaseUnitBitsPerSecond(); diff --git a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs index e1654d7637..4424e1349a 100644 --- a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs @@ -471,7 +471,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(BrakeSpecificFuelConsumption other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(BrakeSpecificFuelConsumption other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitKilogramsPerJoule(); double otherBaseValue = (double)other.AsBaseUnitKilogramsPerJoule(); diff --git a/UnitsNet/GeneratedCode/Quantities/Capacitance.g.cs b/UnitsNet/GeneratedCode/Quantities/Capacitance.g.cs index c4a62a9d33..2e64a5a74e 100644 --- a/UnitsNet/GeneratedCode/Quantities/Capacitance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Capacitance.g.cs @@ -405,7 +405,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(Capacitance other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(Capacitance other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitFarads(); double otherBaseValue = (double)other.AsBaseUnitFarads(); diff --git a/UnitsNet/GeneratedCode/Quantities/Density.g.cs b/UnitsNet/GeneratedCode/Quantities/Density.g.cs index 5aec680f9a..53df2c3763 100644 --- a/UnitsNet/GeneratedCode/Quantities/Density.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Density.g.cs @@ -1626,7 +1626,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(Density other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(Density other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitKilogramsPerCubicMeter(); double otherBaseValue = (double)other.AsBaseUnitKilogramsPerCubicMeter(); diff --git a/UnitsNet/GeneratedCode/Quantities/Duration.g.cs b/UnitsNet/GeneratedCode/Quantities/Duration.g.cs index 4ae4b55547..3c4ad8f972 100644 --- a/UnitsNet/GeneratedCode/Quantities/Duration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Duration.g.cs @@ -770,7 +770,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(Duration other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(Duration other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitSeconds(); double otherBaseValue = (double)other.AsBaseUnitSeconds(); diff --git a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs index ddb91c46bc..41778dfcf0 100644 --- a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs @@ -570,7 +570,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(DynamicViscosity other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(DynamicViscosity other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitNewtonSecondsPerMeterSquared(); double otherBaseValue = (double)other.AsBaseUnitNewtonSecondsPerMeterSquared(); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs index b6b5eb9f32..886f6adc55 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs @@ -504,7 +504,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(ElectricAdmittance other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(ElectricAdmittance other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitSiemens(); double otherBaseValue = (double)other.AsBaseUnitSiemens(); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs index f552025af1..2066d09f39 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs @@ -405,7 +405,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(ElectricCharge other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(ElectricCharge other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitCoulombs(); double otherBaseValue = (double)other.AsBaseUnitCoulombs(); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs index bbc01ffe00..c363e2b5f5 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs @@ -405,7 +405,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(ElectricChargeDensity other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(ElectricChargeDensity other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitCoulombsPerCubicMeter(); double otherBaseValue = (double)other.AsBaseUnitCoulombsPerCubicMeter(); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs index 05e5467889..ce1f25b946 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs @@ -471,7 +471,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(ElectricConductance other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(ElectricConductance other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitSiemens(); double otherBaseValue = (double)other.AsBaseUnitSiemens(); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs index cf28af9c81..8e4eeb2807 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs @@ -405,7 +405,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(ElectricConductivity other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(ElectricConductivity other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitSiemensPerMeter(); double otherBaseValue = (double)other.AsBaseUnitSiemensPerMeter(); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs index fcc3f47031..7d1fc25dbf 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs @@ -603,7 +603,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(ElectricCurrent other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(ElectricCurrent other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitAmperes(); double otherBaseValue = (double)other.AsBaseUnitAmperes(); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs index b44df0a58b..3c25590237 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs @@ -405,7 +405,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(ElectricCurrentDensity other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(ElectricCurrentDensity other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitAmperesPerSquareMeter(); double otherBaseValue = (double)other.AsBaseUnitAmperesPerSquareMeter(); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs index 15b40b6b0e..edc36f71c8 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs @@ -405,7 +405,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(ElectricCurrentGradient other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(ElectricCurrentGradient other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitAmperesPerSecond(); double otherBaseValue = (double)other.AsBaseUnitAmperesPerSecond(); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs index 873341962e..604a522672 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs @@ -405,7 +405,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(ElectricField other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(ElectricField other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitVoltsPerMeter(); double otherBaseValue = (double)other.AsBaseUnitVoltsPerMeter(); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs index 6f11f85530..cb25400055 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs @@ -405,7 +405,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(ElectricInductance other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(ElectricInductance other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitHenries(); double otherBaseValue = (double)other.AsBaseUnitHenries(); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs index 3181d6575a..e01ea2d49f 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs @@ -537,7 +537,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(ElectricPotential other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(ElectricPotential other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitVolts(); double otherBaseValue = (double)other.AsBaseUnitVolts(); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.g.cs index f322a0e8ae..f4d900d97f 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.g.cs @@ -537,7 +537,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(ElectricPotentialAc other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(ElectricPotentialAc other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitVoltsAc(); double otherBaseValue = (double)other.AsBaseUnitVoltsAc(); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.g.cs index 2856d75f08..022a23ce8d 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.g.cs @@ -537,7 +537,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(ElectricPotentialDc other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(ElectricPotentialDc other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitVoltsDc(); double otherBaseValue = (double)other.AsBaseUnitVoltsDc(); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs index d136970736..5beebe7307 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs @@ -504,7 +504,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(ElectricResistance other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(ElectricResistance other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitOhms(); double otherBaseValue = (double)other.AsBaseUnitOhms(); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs index 6ef4b53574..6e5dc17825 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs @@ -504,7 +504,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(ElectricResistivity other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(ElectricResistivity other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitOhmMeters(); double otherBaseValue = (double)other.AsBaseUnitOhmMeters(); diff --git a/UnitsNet/GeneratedCode/Quantities/Energy.g.cs b/UnitsNet/GeneratedCode/Quantities/Energy.g.cs index 2b6c266082..e5cfb22313 100644 --- a/UnitsNet/GeneratedCode/Quantities/Energy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Energy.g.cs @@ -1098,7 +1098,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(Energy other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(Energy other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitJoules(); double otherBaseValue = (double)other.AsBaseUnitJoules(); diff --git a/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs b/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs index 467533994b..e520934bf7 100644 --- a/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs @@ -603,7 +603,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(Entropy other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(Entropy other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitJoulesPerKelvin(); double otherBaseValue = (double)other.AsBaseUnitJoulesPerKelvin(); diff --git a/UnitsNet/GeneratedCode/Quantities/Flow.g.cs b/UnitsNet/GeneratedCode/Quantities/Flow.g.cs index 8c0bf0ab43..d2b9abfd21 100644 --- a/UnitsNet/GeneratedCode/Quantities/Flow.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Flow.g.cs @@ -1182,7 +1182,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(Flow other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(Flow other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitCubicMetersPerSecond(); double otherBaseValue = (double)other.AsBaseUnitCubicMetersPerSecond(); diff --git a/UnitsNet/GeneratedCode/Quantities/Force.g.cs b/UnitsNet/GeneratedCode/Quantities/Force.g.cs index cc22a1297e..dbbcf4e847 100644 --- a/UnitsNet/GeneratedCode/Quantities/Force.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Force.g.cs @@ -702,7 +702,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(Force other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(Force other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitNewtons(); double otherBaseValue = (double)other.AsBaseUnitNewtons(); diff --git a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs index 73fced83dc..407d354007 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs @@ -735,7 +735,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(ForceChangeRate other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(ForceChangeRate other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitNewtonsPerSecond(); double otherBaseValue = (double)other.AsBaseUnitNewtonsPerSecond(); diff --git a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs index b35b791c20..71bdb3ad89 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs @@ -669,7 +669,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(ForcePerLength other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(ForcePerLength other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitNewtonsPerMeter(); double otherBaseValue = (double)other.AsBaseUnitNewtonsPerMeter(); diff --git a/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs b/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs index 67ee979f45..0bfb03a09f 100644 --- a/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs @@ -636,7 +636,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(Frequency other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(Frequency other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitHertz(); double otherBaseValue = (double)other.AsBaseUnitHertz(); diff --git a/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs index 47a3c687ed..479bdfd97a 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs @@ -900,7 +900,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(HeatFlux other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(HeatFlux other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitWattsPerSquareMeter(); double otherBaseValue = (double)other.AsBaseUnitWattsPerSquareMeter(); diff --git a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs index 9c0dc6bd80..6a1754f698 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs @@ -438,7 +438,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(HeatTransferCoefficient other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(HeatTransferCoefficient other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitWattsPerSquareMeterKelvin(); double otherBaseValue = (double)other.AsBaseUnitWattsPerSquareMeterKelvin(); diff --git a/UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs b/UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs index 6d71fdab92..58e47c2ef3 100644 --- a/UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs @@ -504,7 +504,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(Illuminance other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(Illuminance other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitLux(); double otherBaseValue = (double)other.AsBaseUnitLux(); diff --git a/UnitsNet/GeneratedCode/Quantities/Information.g.cs b/UnitsNet/GeneratedCode/Quantities/Information.g.cs index 8808a12aff..a885e12a38 100644 --- a/UnitsNet/GeneratedCode/Quantities/Information.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Information.g.cs @@ -1227,7 +1227,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(Information other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(Information other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitBits(); double otherBaseValue = (double)other.AsBaseUnitBits(); diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs index f025af341b..29384ec2a3 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs @@ -438,7 +438,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(Irradiance other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(Irradiance other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitWattsPerSquareMeter(); double otherBaseValue = (double)other.AsBaseUnitWattsPerSquareMeter(); diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs index 4a26fce37a..d32b652813 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs @@ -471,7 +471,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(Irradiation other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(Irradiation other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitJoulesPerSquareMeter(); double otherBaseValue = (double)other.AsBaseUnitJoulesPerSquareMeter(); diff --git a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs index 131c1c969e..6d82161fa9 100644 --- a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs @@ -636,7 +636,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(KinematicViscosity other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(KinematicViscosity other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitSquareMetersPerSecond(); double otherBaseValue = (double)other.AsBaseUnitSquareMetersPerSecond(); diff --git a/UnitsNet/GeneratedCode/Quantities/LapseRate.g.cs b/UnitsNet/GeneratedCode/Quantities/LapseRate.g.cs index 2e93691de1..d994576bb3 100644 --- a/UnitsNet/GeneratedCode/Quantities/LapseRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LapseRate.g.cs @@ -405,7 +405,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(LapseRate other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(LapseRate other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitDegreesCelciusPerKilometer(); double otherBaseValue = (double)other.AsBaseUnitDegreesCelciusPerKilometer(); diff --git a/UnitsNet/GeneratedCode/Quantities/Length.g.cs b/UnitsNet/GeneratedCode/Quantities/Length.g.cs index 875a6454e2..4837089497 100644 --- a/UnitsNet/GeneratedCode/Quantities/Length.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Length.g.cs @@ -1098,7 +1098,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(Length other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(Length other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitMeters(); double otherBaseValue = (double)other.AsBaseUnitMeters(); diff --git a/UnitsNet/GeneratedCode/Quantities/Level.g.cs b/UnitsNet/GeneratedCode/Quantities/Level.g.cs index 4fabb119ee..c8c4f2cecd 100644 --- a/UnitsNet/GeneratedCode/Quantities/Level.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Level.g.cs @@ -446,7 +446,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(Level other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(Level other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitDecibels(); double otherBaseValue = (double)other.AsBaseUnitDecibels(); diff --git a/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs index 6bbf5d36a4..c1ea0ecdb7 100644 --- a/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs @@ -471,7 +471,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(LinearDensity other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(LinearDensity other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitKilogramsPerMeter(); double otherBaseValue = (double)other.AsBaseUnitKilogramsPerMeter(); diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.g.cs index 045a3a4c9f..eaae8d04c5 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.g.cs @@ -405,7 +405,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(LuminousFlux other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(LuminousFlux other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitLumens(); double otherBaseValue = (double)other.AsBaseUnitLumens(); diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs index d4066ece21..547631b29f 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs @@ -405,7 +405,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(LuminousIntensity other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(LuminousIntensity other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitCandela(); double otherBaseValue = (double)other.AsBaseUnitCandela(); diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticField.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticField.g.cs index 0eef14a725..5337a53b8a 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticField.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticField.g.cs @@ -405,7 +405,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(MagneticField other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(MagneticField other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitTeslas(); double otherBaseValue = (double)other.AsBaseUnitTeslas(); diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.g.cs index 15d9f2cda9..f387f7d869 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.g.cs @@ -405,7 +405,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(MagneticFlux other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(MagneticFlux other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitWebers(); double otherBaseValue = (double)other.AsBaseUnitWebers(); diff --git a/UnitsNet/GeneratedCode/Quantities/Magnetization.g.cs b/UnitsNet/GeneratedCode/Quantities/Magnetization.g.cs index 5fc881c9cb..5ce99713ec 100644 --- a/UnitsNet/GeneratedCode/Quantities/Magnetization.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Magnetization.g.cs @@ -405,7 +405,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(Magnetization other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(Magnetization other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitAmperesPerMeter(); double otherBaseValue = (double)other.AsBaseUnitAmperesPerMeter(); diff --git a/UnitsNet/GeneratedCode/Quantities/Mass.g.cs b/UnitsNet/GeneratedCode/Quantities/Mass.g.cs index ff60bb4ae4..d772945e67 100644 --- a/UnitsNet/GeneratedCode/Quantities/Mass.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Mass.g.cs @@ -1065,7 +1065,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(Mass other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(Mass other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitKilograms(); double otherBaseValue = (double)other.AsBaseUnitKilograms(); diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs index 200cd3908c..20e8b579db 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs @@ -867,7 +867,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(MassFlow other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(MassFlow other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitGramsPerSecond(); double otherBaseValue = (double)other.AsBaseUnitGramsPerSecond(); diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs index 8fb15f3681..e282d1b6c3 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs @@ -438,7 +438,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(MassFlux other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(MassFlux other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitKilogramsPerSecondPerSquareMeter(); double otherBaseValue = (double)other.AsBaseUnitKilogramsPerSecondPerSquareMeter(); diff --git a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.g.cs b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.g.cs index fe9eaee6ff..29ca44f94f 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.g.cs @@ -1230,7 +1230,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(MassMomentOfInertia other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(MassMomentOfInertia other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitKilogramSquareMeters(); double otherBaseValue = (double)other.AsBaseUnitKilogramSquareMeters(); diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.g.cs index 6185aaaeae..46be6f2bb6 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.g.cs @@ -471,7 +471,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(MolarEnergy other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(MolarEnergy other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitJoulesPerMole(); double otherBaseValue = (double)other.AsBaseUnitJoulesPerMole(); diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.g.cs index b5f2d7d2d9..e362c84eaa 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.g.cs @@ -471,7 +471,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(MolarEntropy other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(MolarEntropy other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitJoulesPerMoleKelvin(); double otherBaseValue = (double)other.AsBaseUnitJoulesPerMoleKelvin(); diff --git a/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs index 7cfa0f2296..86970fb796 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs @@ -768,7 +768,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(MolarMass other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(MolarMass other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitKilogramsPerMole(); double otherBaseValue = (double)other.AsBaseUnitKilogramsPerMole(); diff --git a/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs b/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs index e0b40258e1..177fbc9424 100644 --- a/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs @@ -636,7 +636,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(Molarity other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(Molarity other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitMolesPerCubicMeter(); double otherBaseValue = (double)other.AsBaseUnitMolesPerCubicMeter(); diff --git a/UnitsNet/GeneratedCode/Quantities/Permeability.g.cs b/UnitsNet/GeneratedCode/Quantities/Permeability.g.cs index a4a6229d56..05c733c643 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permeability.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permeability.g.cs @@ -405,7 +405,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(Permeability other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(Permeability other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitHenriesPerMeter(); double otherBaseValue = (double)other.AsBaseUnitHenriesPerMeter(); diff --git a/UnitsNet/GeneratedCode/Quantities/Permittivity.g.cs b/UnitsNet/GeneratedCode/Quantities/Permittivity.g.cs index 860f0463c0..955372cc5d 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permittivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permittivity.g.cs @@ -405,7 +405,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(Permittivity other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(Permittivity other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitFaradsPerMeter(); double otherBaseValue = (double)other.AsBaseUnitFaradsPerMeter(); diff --git a/UnitsNet/GeneratedCode/Quantities/Power.g.cs b/UnitsNet/GeneratedCode/Quantities/Power.g.cs index 97bbccc165..fbf738a5f1 100644 --- a/UnitsNet/GeneratedCode/Quantities/Power.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Power.g.cs @@ -1029,7 +1029,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(Power other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(Power other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitWatts(); double otherBaseValue = (double)other.AsBaseUnitWatts(); diff --git a/UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs index dbc35bc070..564aa06e7a 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs @@ -1890,7 +1890,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(PowerDensity other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(PowerDensity other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitWattsPerCubicMeter(); double otherBaseValue = (double)other.AsBaseUnitWattsPerCubicMeter(); diff --git a/UnitsNet/GeneratedCode/Quantities/PowerRatio.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerRatio.g.cs index b1b834aa46..0705c903a3 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerRatio.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerRatio.g.cs @@ -446,7 +446,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(PowerRatio other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(PowerRatio other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitDecibelWatts(); double otherBaseValue = (double)other.AsBaseUnitDecibelWatts(); diff --git a/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs b/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs index e844b45655..2bf9e47c0a 100644 --- a/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs @@ -1627,7 +1627,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(Pressure other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(Pressure other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitPascals(); double otherBaseValue = (double)other.AsBaseUnitPascals(); diff --git a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs index c9adbc477d..5027a7b2b3 100644 --- a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs @@ -504,7 +504,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(PressureChangeRate other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(PressureChangeRate other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitPascalsPerSecond(); double otherBaseValue = (double)other.AsBaseUnitPascalsPerSecond(); diff --git a/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs b/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs index e8b1494009..553c4d4224 100644 --- a/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs @@ -570,7 +570,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(Ratio other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(Ratio other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitDecimalFractions(); double otherBaseValue = (double)other.AsBaseUnitDecimalFractions(); diff --git a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.g.cs index ec2e7b1510..d570a950ab 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.g.cs @@ -471,7 +471,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(ReactiveEnergy other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(ReactiveEnergy other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitVoltampereReactiveHours(); double otherBaseValue = (double)other.AsBaseUnitVoltampereReactiveHours(); diff --git a/UnitsNet/GeneratedCode/Quantities/ReactivePower.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactivePower.g.cs index 3cc3e55095..95e809d8be 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactivePower.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactivePower.g.cs @@ -504,7 +504,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(ReactivePower other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(ReactivePower other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitVoltamperesReactive(); double otherBaseValue = (double)other.AsBaseUnitVoltamperesReactive(); diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.g.cs index b65ed47491..e067995b63 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.g.cs @@ -471,7 +471,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(RotationalAcceleration other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(RotationalAcceleration other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitRadiansPerSecondSquared(); double otherBaseValue = (double)other.AsBaseUnitRadiansPerSecondSquared(); diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs index 5367120311..4ebd0d98b7 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs @@ -801,7 +801,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(RotationalSpeed other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(RotationalSpeed other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitRadiansPerSecond(); double otherBaseValue = (double)other.AsBaseUnitRadiansPerSecond(); diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs index 209a4ea73f..4b2f7cd2a6 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs @@ -471,7 +471,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(RotationalStiffness other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(RotationalStiffness other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitNewtonMetersPerRadian(); double otherBaseValue = (double)other.AsBaseUnitNewtonMetersPerRadian(); diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs index da76c7cdd3..dfb0e83bc0 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs @@ -471,7 +471,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(RotationalStiffnessPerLength other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(RotationalStiffnessPerLength other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitNewtonMetersPerRadianPerMeter(); double otherBaseValue = (double)other.AsBaseUnitNewtonMetersPerRadianPerMeter(); diff --git a/UnitsNet/GeneratedCode/Quantities/SolidAngle.g.cs b/UnitsNet/GeneratedCode/Quantities/SolidAngle.g.cs index 49719d5944..9889ebdfb0 100644 --- a/UnitsNet/GeneratedCode/Quantities/SolidAngle.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SolidAngle.g.cs @@ -405,7 +405,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(SolidAngle other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(SolidAngle other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitSteradians(); double otherBaseValue = (double)other.AsBaseUnitSteradians(); diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs index 0f138790d8..776cf2577b 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs @@ -636,7 +636,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(SpecificEnergy other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(SpecificEnergy other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitJoulesPerKilogram(); double otherBaseValue = (double)other.AsBaseUnitJoulesPerKilogram(); diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs index 1ae7083ab3..f02fe22b7e 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs @@ -636,7 +636,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(SpecificEntropy other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(SpecificEntropy other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitJoulesPerKilogramKelvin(); double otherBaseValue = (double)other.AsBaseUnitJoulesPerKilogramKelvin(); diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs index 74e7e0ce19..b4f37c4c99 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs @@ -405,7 +405,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(SpecificVolume other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(SpecificVolume other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitCubicMetersPerKilogram(); double otherBaseValue = (double)other.AsBaseUnitCubicMetersPerKilogram(); diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs index 3773e56555..05de9b7bab 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs @@ -933,7 +933,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(SpecificWeight other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(SpecificWeight other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitNewtonsPerCubicMeter(); double otherBaseValue = (double)other.AsBaseUnitNewtonsPerCubicMeter(); diff --git a/UnitsNet/GeneratedCode/Quantities/Speed.g.cs b/UnitsNet/GeneratedCode/Quantities/Speed.g.cs index 9033e08d24..e5061f488a 100644 --- a/UnitsNet/GeneratedCode/Quantities/Speed.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Speed.g.cs @@ -1428,7 +1428,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(Speed other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(Speed other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitMetersPerSecond(); double otherBaseValue = (double)other.AsBaseUnitMetersPerSecond(); diff --git a/UnitsNet/GeneratedCode/Quantities/Temperature.g.cs b/UnitsNet/GeneratedCode/Quantities/Temperature.g.cs index 5caabf5a08..7221bc281b 100644 --- a/UnitsNet/GeneratedCode/Quantities/Temperature.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Temperature.g.cs @@ -594,7 +594,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(Temperature other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(Temperature other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitKelvins(); double otherBaseValue = (double)other.AsBaseUnitKelvins(); diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.g.cs index 8ea4fea7a7..662183c8ac 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.g.cs @@ -702,7 +702,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(TemperatureChangeRate other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(TemperatureChangeRate other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitDegreesCelsiusPerSecond(); double otherBaseValue = (double)other.AsBaseUnitDegreesCelsiusPerSecond(); diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs index 55f94d9f90..75a0a6c98b 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs @@ -908,7 +908,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(TemperatureDelta other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(TemperatureDelta other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitKelvins(); double otherBaseValue = (double)other.AsBaseUnitKelvins(); diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.g.cs index 59474b9785..3a00343d4b 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.g.cs @@ -438,7 +438,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(ThermalConductivity other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(ThermalConductivity other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitWattsPerMeterKelvin(); double otherBaseValue = (double)other.AsBaseUnitWattsPerMeterKelvin(); diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.g.cs index 79ff69280f..e6cdf4a48d 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.g.cs @@ -537,7 +537,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(ThermalResistance other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(ThermalResistance other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitSquareMeterKelvinsPerKilowatt(); double otherBaseValue = (double)other.AsBaseUnitSquareMeterKelvinsPerKilowatt(); diff --git a/UnitsNet/GeneratedCode/Quantities/Torque.g.cs b/UnitsNet/GeneratedCode/Quantities/Torque.g.cs index 1a30d85300..47102079b6 100644 --- a/UnitsNet/GeneratedCode/Quantities/Torque.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Torque.g.cs @@ -1065,7 +1065,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(Torque other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(Torque other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitNewtonMeters(); double otherBaseValue = (double)other.AsBaseUnitNewtonMeters(); diff --git a/UnitsNet/GeneratedCode/Quantities/VitaminA.g.cs b/UnitsNet/GeneratedCode/Quantities/VitaminA.g.cs index e2cea68a6f..9033a04e6a 100644 --- a/UnitsNet/GeneratedCode/Quantities/VitaminA.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VitaminA.g.cs @@ -405,7 +405,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(VitaminA other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(VitaminA other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitInternationalUnits(); double otherBaseValue = (double)other.AsBaseUnitInternationalUnits(); diff --git a/UnitsNet/GeneratedCode/Quantities/Volume.g.cs b/UnitsNet/GeneratedCode/Quantities/Volume.g.cs index 9b485467f5..c787eb08a9 100644 --- a/UnitsNet/GeneratedCode/Quantities/Volume.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Volume.g.cs @@ -1826,7 +1826,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(Volume other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(Volume other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitCubicMeters(); double otherBaseValue = (double)other.AsBaseUnitCubicMeters(); diff --git a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs index d8fb0004a8..3bb931da74 100644 --- a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs @@ -1164,7 +1164,7 @@ public override bool Equals(object obj) /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals(VolumeFlow other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals(VolumeFlow other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnitCubicMetersPerSecond(); double otherBaseValue = (double)other.AsBaseUnitCubicMetersPerSecond(); diff --git a/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 b/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 index 7112f7f8a0..50a9427a4f 100644 --- a/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 +++ b/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 @@ -455,7 +455,7 @@ namespace UnitsNet /// The comparison tolerance. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. - public bool Equals($quantityName other, double tolerance = 0.00001, ComparisonType comparisonType = ComparisonType.Relative) + public bool Equals($quantityName other, double tolerance, ComparisonType comparisonType) { double baseValue = (double)AsBaseUnit$baseUnitPluralName(); double otherBaseValue = (double)other.AsBaseUnit$baseUnitPluralName(); From 35a8d4c33ec7930de630d54a1d00667bdfe94897 Mon Sep 17 00:00:00 2001 From: Tristan Milnthorp Date: Thu, 21 Jun 2018 14:54:31 -0400 Subject: [PATCH 04/19] Fixing therm(UK) values --- UnitsNet.Tests/CustomCode/EnergyTests.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Energy.g.cs | 8 ++++---- UnitsNet/UnitDefinitions/Energy.json | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/UnitsNet.Tests/CustomCode/EnergyTests.cs b/UnitsNet.Tests/CustomCode/EnergyTests.cs index 67be4cccfe..c13006e2f1 100644 --- a/UnitsNet.Tests/CustomCode/EnergyTests.cs +++ b/UnitsNet.Tests/CustomCode/EnergyTests.cs @@ -24,7 +24,7 @@ namespace UnitsNet.Tests.CustomCode public class EnergyTests : EnergyTestsBase { // TODO Override properties in base class here - protected override double ThermsImperialInOneJoule => 9.4369e-9; + protected override double ThermsImperialInOneJoule => 9.478171203551087813109937767482e-9; protected override double JoulesInOneJoule => 1; @@ -42,7 +42,7 @@ public class EnergyTests : EnergyTestsBase protected override double DecathermsEcInOneJoule => 9.478171203133172e-10; - protected override double DecathermsImperialInOneJoule => 9.4369e-10; + protected override double DecathermsImperialInOneJoule => 9.478171203551087813109937767482e-10; protected override double DecathermsUsInOneJoule => 9.480434279733486e-10; diff --git a/UnitsNet/GeneratedCode/Quantities/Energy.g.cs b/UnitsNet/GeneratedCode/Quantities/Energy.g.cs index e5cfb22313..e4fb555f2b 100644 --- a/UnitsNet/GeneratedCode/Quantities/Energy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Energy.g.cs @@ -1146,7 +1146,7 @@ public double As(EnergyUnit unit) case EnergyUnit.BritishThermalUnit: return baseUnitValue/1055.05585262; case EnergyUnit.Calorie: return baseUnitValue/4.184; case EnergyUnit.DecathermEc: return (baseUnitValue/1.05505585262e8) / 1e1d; - case EnergyUnit.DecathermImperial: return (baseUnitValue/1.05967e8) / 1e1d; + case EnergyUnit.DecathermImperial: return (baseUnitValue/1.05505585257348e8) / 1e1d; case EnergyUnit.DecathermUs: return (baseUnitValue/1.054804e8) / 1e1d; case EnergyUnit.ElectronVolt: return baseUnitValue/1.602176565e-19; case EnergyUnit.Erg: return baseUnitValue/1e-7; @@ -1162,7 +1162,7 @@ public double As(EnergyUnit unit) case EnergyUnit.Megajoule: return (baseUnitValue) / 1e6d; case EnergyUnit.MegawattHour: return (baseUnitValue/3600d) / 1e6d; case EnergyUnit.ThermEc: return baseUnitValue/1.05505585262e8; - case EnergyUnit.ThermImperial: return baseUnitValue/1.05967e8; + case EnergyUnit.ThermImperial: return baseUnitValue/1.05505585257348e8; case EnergyUnit.ThermUs: return baseUnitValue/1.054804e8; case EnergyUnit.WattHour: return baseUnitValue/3600d; @@ -1531,7 +1531,7 @@ private double AsBaseUnitJoules() case EnergyUnit.BritishThermalUnit: return _value*1055.05585262; case EnergyUnit.Calorie: return _value*4.184; case EnergyUnit.DecathermEc: return (_value*1.05505585262e8) * 1e1d; - case EnergyUnit.DecathermImperial: return (_value*1.05967e8) * 1e1d; + case EnergyUnit.DecathermImperial: return (_value*1.05505585257348e8) * 1e1d; case EnergyUnit.DecathermUs: return (_value*1.054804e8) * 1e1d; case EnergyUnit.ElectronVolt: return _value*1.602176565e-19; case EnergyUnit.Erg: return _value*1e-7; @@ -1547,7 +1547,7 @@ private double AsBaseUnitJoules() case EnergyUnit.Megajoule: return (_value) * 1e6d; case EnergyUnit.MegawattHour: return (_value*3600d) * 1e6d; case EnergyUnit.ThermEc: return _value*1.05505585262e8; - case EnergyUnit.ThermImperial: return _value*1.05967e8; + case EnergyUnit.ThermImperial: return _value*1.05505585257348e8; case EnergyUnit.ThermUs: return _value*1.054804e8; case EnergyUnit.WattHour: return _value*3600d; default: diff --git a/UnitsNet/UnitDefinitions/Energy.json b/UnitsNet/UnitDefinitions/Energy.json index 160a987296..4ecf9e7c4e 100644 --- a/UnitsNet/UnitDefinitions/Energy.json +++ b/UnitsNet/UnitDefinitions/Energy.json @@ -136,8 +136,8 @@ { "SingularName": "ThermImperial", "PluralName": "ThermsImperial", - "FromUnitToBaseFunc": "x*1.05967e8", - "FromBaseToUnitFunc": "x/1.05967e8", + "FromUnitToBaseFunc": "x*1.05505585257348e8", + "FromBaseToUnitFunc": "x/1.05505585257348e8", "Prefixes": [ "Deca" ], "Localization": [ { From 74c3faaeddb0f7b10e62ad5c32405465dade9292 Mon Sep 17 00:00:00 2001 From: Tristan Milnthorp Date: Thu, 21 Jun 2018 14:55:15 -0400 Subject: [PATCH 05/19] Relative difference calculation should be against expected value. Replacing manual percentage calculation with format strings. --- UnitsNet.Tests/AssertEx.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/UnitsNet.Tests/AssertEx.cs b/UnitsNet.Tests/AssertEx.cs index bce42bdeec..7e553f92bc 100644 --- a/UnitsNet.Tests/AssertEx.cs +++ b/UnitsNet.Tests/AssertEx.cs @@ -15,9 +15,9 @@ public static void EqualTolerance(double expected, double actual, double toleran bool areEqual = UnitsNet.Comparison.EqualsRelative(expected, actual, tolerance); double difference = Math.Abs(expected - actual); - double percentDifference = (difference / actual) * 100.0d; + double relativeDifference = difference / expected; - Assert.True( areEqual, $"Values are not equal within relative tolerance: {tolerance * 100.0d}%\nExpected: {expected}\nActual: {actual}\nDiff: {percentDifference}%" ); + Assert.True( areEqual, $"Values are not equal within relative tolerance: {tolerance:P4}\nExpected: {expected}\nActual: {actual}\nDiff: {relativeDifference:P4}" ); } else if( comparisonType == ComparisonType.Absolute ) { From 9fe2dbcb69ac0da0e806d7b1ad0b48ba045556e5 Mon Sep 17 00:00:00 2001 From: Tristan Milnthorp Date: Thu, 21 Jun 2018 14:56:50 -0400 Subject: [PATCH 06/19] Removing power density prefixes for another day --- .../CustomCode/PowerDensityTests.cs | 2 - .../GeneratedCode/PowerDensityTestsBase.g.cs | 12 ---- .../NumberToPowerDensityExtensions.g.cs | 68 ------------------ .../Quantities/PowerDensity.g.cs | 70 ------------------- .../GeneratedCode/UnitSystem.Default.g.cs | 10 --- .../GeneratedCode/Units/PowerDensityUnit.g.cs | 2 - UnitsNet/UnitDefinitions/PowerDensity.json | 2 +- 7 files changed, 1 insertion(+), 165 deletions(-) diff --git a/UnitsNet.Tests/CustomCode/PowerDensityTests.cs b/UnitsNet.Tests/CustomCode/PowerDensityTests.cs index 9b26ed43f3..abc3dfac11 100644 --- a/UnitsNet.Tests/CustomCode/PowerDensityTests.cs +++ b/UnitsNet.Tests/CustomCode/PowerDensityTests.cs @@ -47,7 +47,6 @@ namespace UnitsNet.Tests.CustomCode public class PowerDensityTests : PowerDensityTestsBase { protected override double WattsPerCubicMeterInOneWattPerCubicMeter => 1; - protected override double FemtowattsPerCubicMeterInOneWattPerCubicMeter => 1e15; protected override double PicowattsPerCubicMeterInOneWattPerCubicMeter => 1e12; protected override double NanowattsPerCubicMeterInOneWattPerCubicMeter => 1e9; protected override double MicrowattsPerCubicMeterInOneWattPerCubicMeter => 1e6; @@ -58,7 +57,6 @@ public class PowerDensityTests : PowerDensityTestsBase protected override double MegawattsPerCubicMeterInOneWattPerCubicMeter => 1e-6; protected override double GigawattsPerCubicMeterInOneWattPerCubicMeter => 1e-9; protected override double TerawattsPerCubicMeterInOneWattPerCubicMeter => 1e-12; - protected override double PetawattsPerCubicMeterInOneWattPerCubicMeter => 1e-15; protected override double WattsPerCubicInchInOneWattPerCubicMeter => 1.6387064e-5; protected override double PicowattsPerCubicInchInOneWattPerCubicMeter => 1.6387064e7; diff --git a/UnitsNet.Tests/GeneratedCode/PowerDensityTestsBase.g.cs b/UnitsNet.Tests/GeneratedCode/PowerDensityTestsBase.g.cs index df98206cfa..64cfa350c2 100644 --- a/UnitsNet.Tests/GeneratedCode/PowerDensityTestsBase.g.cs +++ b/UnitsNet.Tests/GeneratedCode/PowerDensityTestsBase.g.cs @@ -60,7 +60,6 @@ public abstract partial class PowerDensityTestsBase protected abstract double DeciwattsPerCubicInchInOneWattPerCubicMeter { get; } protected abstract double DeciwattsPerCubicMeterInOneWattPerCubicMeter { get; } protected abstract double DeciwattsPerLiterInOneWattPerCubicMeter { get; } - protected abstract double FemtowattsPerCubicMeterInOneWattPerCubicMeter { get; } protected abstract double GigawattsPerCubicFootInOneWattPerCubicMeter { get; } protected abstract double GigawattsPerCubicInchInOneWattPerCubicMeter { get; } protected abstract double GigawattsPerCubicMeterInOneWattPerCubicMeter { get; } @@ -85,7 +84,6 @@ public abstract partial class PowerDensityTestsBase protected abstract double NanowattsPerCubicInchInOneWattPerCubicMeter { get; } protected abstract double NanowattsPerCubicMeterInOneWattPerCubicMeter { get; } protected abstract double NanowattsPerLiterInOneWattPerCubicMeter { get; } - protected abstract double PetawattsPerCubicMeterInOneWattPerCubicMeter { get; } protected abstract double PicowattsPerCubicFootInOneWattPerCubicMeter { get; } protected abstract double PicowattsPerCubicInchInOneWattPerCubicMeter { get; } protected abstract double PicowattsPerCubicMeterInOneWattPerCubicMeter { get; } @@ -108,7 +106,6 @@ public abstract partial class PowerDensityTestsBase protected virtual double DeciwattsPerCubicInchTolerance { get { return 1e-5; } } protected virtual double DeciwattsPerCubicMeterTolerance { get { return 1e-5; } } protected virtual double DeciwattsPerLiterTolerance { get { return 1e-5; } } - protected virtual double FemtowattsPerCubicMeterTolerance { get { return 1e-5; } } protected virtual double GigawattsPerCubicFootTolerance { get { return 1e-5; } } protected virtual double GigawattsPerCubicInchTolerance { get { return 1e-5; } } protected virtual double GigawattsPerCubicMeterTolerance { get { return 1e-5; } } @@ -133,7 +130,6 @@ public abstract partial class PowerDensityTestsBase protected virtual double NanowattsPerCubicInchTolerance { get { return 1e-5; } } protected virtual double NanowattsPerCubicMeterTolerance { get { return 1e-5; } } protected virtual double NanowattsPerLiterTolerance { get { return 1e-5; } } - protected virtual double PetawattsPerCubicMeterTolerance { get { return 1e-5; } } protected virtual double PicowattsPerCubicFootTolerance { get { return 1e-5; } } protected virtual double PicowattsPerCubicInchTolerance { get { return 1e-5; } } protected virtual double PicowattsPerCubicMeterTolerance { get { return 1e-5; } } @@ -160,7 +156,6 @@ public void WattPerCubicMeterToPowerDensityUnits() AssertEx.EqualTolerance(DeciwattsPerCubicInchInOneWattPerCubicMeter, wattpercubicmeter.DeciwattsPerCubicInch, DeciwattsPerCubicInchTolerance); AssertEx.EqualTolerance(DeciwattsPerCubicMeterInOneWattPerCubicMeter, wattpercubicmeter.DeciwattsPerCubicMeter, DeciwattsPerCubicMeterTolerance); AssertEx.EqualTolerance(DeciwattsPerLiterInOneWattPerCubicMeter, wattpercubicmeter.DeciwattsPerLiter, DeciwattsPerLiterTolerance); - AssertEx.EqualTolerance(FemtowattsPerCubicMeterInOneWattPerCubicMeter, wattpercubicmeter.FemtowattsPerCubicMeter, FemtowattsPerCubicMeterTolerance); AssertEx.EqualTolerance(GigawattsPerCubicFootInOneWattPerCubicMeter, wattpercubicmeter.GigawattsPerCubicFoot, GigawattsPerCubicFootTolerance); AssertEx.EqualTolerance(GigawattsPerCubicInchInOneWattPerCubicMeter, wattpercubicmeter.GigawattsPerCubicInch, GigawattsPerCubicInchTolerance); AssertEx.EqualTolerance(GigawattsPerCubicMeterInOneWattPerCubicMeter, wattpercubicmeter.GigawattsPerCubicMeter, GigawattsPerCubicMeterTolerance); @@ -185,7 +180,6 @@ public void WattPerCubicMeterToPowerDensityUnits() AssertEx.EqualTolerance(NanowattsPerCubicInchInOneWattPerCubicMeter, wattpercubicmeter.NanowattsPerCubicInch, NanowattsPerCubicInchTolerance); AssertEx.EqualTolerance(NanowattsPerCubicMeterInOneWattPerCubicMeter, wattpercubicmeter.NanowattsPerCubicMeter, NanowattsPerCubicMeterTolerance); AssertEx.EqualTolerance(NanowattsPerLiterInOneWattPerCubicMeter, wattpercubicmeter.NanowattsPerLiter, NanowattsPerLiterTolerance); - AssertEx.EqualTolerance(PetawattsPerCubicMeterInOneWattPerCubicMeter, wattpercubicmeter.PetawattsPerCubicMeter, PetawattsPerCubicMeterTolerance); AssertEx.EqualTolerance(PicowattsPerCubicFootInOneWattPerCubicMeter, wattpercubicmeter.PicowattsPerCubicFoot, PicowattsPerCubicFootTolerance); AssertEx.EqualTolerance(PicowattsPerCubicInchInOneWattPerCubicMeter, wattpercubicmeter.PicowattsPerCubicInch, PicowattsPerCubicInchTolerance); AssertEx.EqualTolerance(PicowattsPerCubicMeterInOneWattPerCubicMeter, wattpercubicmeter.PicowattsPerCubicMeter, PicowattsPerCubicMeterTolerance); @@ -211,7 +205,6 @@ public void FromValueAndUnit() AssertEx.EqualTolerance(1, PowerDensity.From(1, PowerDensityUnit.DeciwattPerCubicInch).DeciwattsPerCubicInch, DeciwattsPerCubicInchTolerance); AssertEx.EqualTolerance(1, PowerDensity.From(1, PowerDensityUnit.DeciwattPerCubicMeter).DeciwattsPerCubicMeter, DeciwattsPerCubicMeterTolerance); AssertEx.EqualTolerance(1, PowerDensity.From(1, PowerDensityUnit.DeciwattPerLiter).DeciwattsPerLiter, DeciwattsPerLiterTolerance); - AssertEx.EqualTolerance(1, PowerDensity.From(1, PowerDensityUnit.FemtowattPerCubicMeter).FemtowattsPerCubicMeter, FemtowattsPerCubicMeterTolerance); AssertEx.EqualTolerance(1, PowerDensity.From(1, PowerDensityUnit.GigawattPerCubicFoot).GigawattsPerCubicFoot, GigawattsPerCubicFootTolerance); AssertEx.EqualTolerance(1, PowerDensity.From(1, PowerDensityUnit.GigawattPerCubicInch).GigawattsPerCubicInch, GigawattsPerCubicInchTolerance); AssertEx.EqualTolerance(1, PowerDensity.From(1, PowerDensityUnit.GigawattPerCubicMeter).GigawattsPerCubicMeter, GigawattsPerCubicMeterTolerance); @@ -236,7 +229,6 @@ public void FromValueAndUnit() AssertEx.EqualTolerance(1, PowerDensity.From(1, PowerDensityUnit.NanowattPerCubicInch).NanowattsPerCubicInch, NanowattsPerCubicInchTolerance); AssertEx.EqualTolerance(1, PowerDensity.From(1, PowerDensityUnit.NanowattPerCubicMeter).NanowattsPerCubicMeter, NanowattsPerCubicMeterTolerance); AssertEx.EqualTolerance(1, PowerDensity.From(1, PowerDensityUnit.NanowattPerLiter).NanowattsPerLiter, NanowattsPerLiterTolerance); - AssertEx.EqualTolerance(1, PowerDensity.From(1, PowerDensityUnit.PetawattPerCubicMeter).PetawattsPerCubicMeter, PetawattsPerCubicMeterTolerance); AssertEx.EqualTolerance(1, PowerDensity.From(1, PowerDensityUnit.PicowattPerCubicFoot).PicowattsPerCubicFoot, PicowattsPerCubicFootTolerance); AssertEx.EqualTolerance(1, PowerDensity.From(1, PowerDensityUnit.PicowattPerCubicInch).PicowattsPerCubicInch, PicowattsPerCubicInchTolerance); AssertEx.EqualTolerance(1, PowerDensity.From(1, PowerDensityUnit.PicowattPerCubicMeter).PicowattsPerCubicMeter, PicowattsPerCubicMeterTolerance); @@ -263,7 +255,6 @@ public void As() AssertEx.EqualTolerance(DeciwattsPerCubicInchInOneWattPerCubicMeter, wattpercubicmeter.As(PowerDensityUnit.DeciwattPerCubicInch), DeciwattsPerCubicInchTolerance); AssertEx.EqualTolerance(DeciwattsPerCubicMeterInOneWattPerCubicMeter, wattpercubicmeter.As(PowerDensityUnit.DeciwattPerCubicMeter), DeciwattsPerCubicMeterTolerance); AssertEx.EqualTolerance(DeciwattsPerLiterInOneWattPerCubicMeter, wattpercubicmeter.As(PowerDensityUnit.DeciwattPerLiter), DeciwattsPerLiterTolerance); - AssertEx.EqualTolerance(FemtowattsPerCubicMeterInOneWattPerCubicMeter, wattpercubicmeter.As(PowerDensityUnit.FemtowattPerCubicMeter), FemtowattsPerCubicMeterTolerance); AssertEx.EqualTolerance(GigawattsPerCubicFootInOneWattPerCubicMeter, wattpercubicmeter.As(PowerDensityUnit.GigawattPerCubicFoot), GigawattsPerCubicFootTolerance); AssertEx.EqualTolerance(GigawattsPerCubicInchInOneWattPerCubicMeter, wattpercubicmeter.As(PowerDensityUnit.GigawattPerCubicInch), GigawattsPerCubicInchTolerance); AssertEx.EqualTolerance(GigawattsPerCubicMeterInOneWattPerCubicMeter, wattpercubicmeter.As(PowerDensityUnit.GigawattPerCubicMeter), GigawattsPerCubicMeterTolerance); @@ -288,7 +279,6 @@ public void As() AssertEx.EqualTolerance(NanowattsPerCubicInchInOneWattPerCubicMeter, wattpercubicmeter.As(PowerDensityUnit.NanowattPerCubicInch), NanowattsPerCubicInchTolerance); AssertEx.EqualTolerance(NanowattsPerCubicMeterInOneWattPerCubicMeter, wattpercubicmeter.As(PowerDensityUnit.NanowattPerCubicMeter), NanowattsPerCubicMeterTolerance); AssertEx.EqualTolerance(NanowattsPerLiterInOneWattPerCubicMeter, wattpercubicmeter.As(PowerDensityUnit.NanowattPerLiter), NanowattsPerLiterTolerance); - AssertEx.EqualTolerance(PetawattsPerCubicMeterInOneWattPerCubicMeter, wattpercubicmeter.As(PowerDensityUnit.PetawattPerCubicMeter), PetawattsPerCubicMeterTolerance); AssertEx.EqualTolerance(PicowattsPerCubicFootInOneWattPerCubicMeter, wattpercubicmeter.As(PowerDensityUnit.PicowattPerCubicFoot), PicowattsPerCubicFootTolerance); AssertEx.EqualTolerance(PicowattsPerCubicInchInOneWattPerCubicMeter, wattpercubicmeter.As(PowerDensityUnit.PicowattPerCubicInch), PicowattsPerCubicInchTolerance); AssertEx.EqualTolerance(PicowattsPerCubicMeterInOneWattPerCubicMeter, wattpercubicmeter.As(PowerDensityUnit.PicowattPerCubicMeter), PicowattsPerCubicMeterTolerance); @@ -315,7 +305,6 @@ public void ConversionRoundTrip() AssertEx.EqualTolerance(1, PowerDensity.FromDeciwattsPerCubicInch(wattpercubicmeter.DeciwattsPerCubicInch).WattsPerCubicMeter, DeciwattsPerCubicInchTolerance); AssertEx.EqualTolerance(1, PowerDensity.FromDeciwattsPerCubicMeter(wattpercubicmeter.DeciwattsPerCubicMeter).WattsPerCubicMeter, DeciwattsPerCubicMeterTolerance); AssertEx.EqualTolerance(1, PowerDensity.FromDeciwattsPerLiter(wattpercubicmeter.DeciwattsPerLiter).WattsPerCubicMeter, DeciwattsPerLiterTolerance); - AssertEx.EqualTolerance(1, PowerDensity.FromFemtowattsPerCubicMeter(wattpercubicmeter.FemtowattsPerCubicMeter).WattsPerCubicMeter, FemtowattsPerCubicMeterTolerance); AssertEx.EqualTolerance(1, PowerDensity.FromGigawattsPerCubicFoot(wattpercubicmeter.GigawattsPerCubicFoot).WattsPerCubicMeter, GigawattsPerCubicFootTolerance); AssertEx.EqualTolerance(1, PowerDensity.FromGigawattsPerCubicInch(wattpercubicmeter.GigawattsPerCubicInch).WattsPerCubicMeter, GigawattsPerCubicInchTolerance); AssertEx.EqualTolerance(1, PowerDensity.FromGigawattsPerCubicMeter(wattpercubicmeter.GigawattsPerCubicMeter).WattsPerCubicMeter, GigawattsPerCubicMeterTolerance); @@ -340,7 +329,6 @@ public void ConversionRoundTrip() AssertEx.EqualTolerance(1, PowerDensity.FromNanowattsPerCubicInch(wattpercubicmeter.NanowattsPerCubicInch).WattsPerCubicMeter, NanowattsPerCubicInchTolerance); AssertEx.EqualTolerance(1, PowerDensity.FromNanowattsPerCubicMeter(wattpercubicmeter.NanowattsPerCubicMeter).WattsPerCubicMeter, NanowattsPerCubicMeterTolerance); AssertEx.EqualTolerance(1, PowerDensity.FromNanowattsPerLiter(wattpercubicmeter.NanowattsPerLiter).WattsPerCubicMeter, NanowattsPerLiterTolerance); - AssertEx.EqualTolerance(1, PowerDensity.FromPetawattsPerCubicMeter(wattpercubicmeter.PetawattsPerCubicMeter).WattsPerCubicMeter, PetawattsPerCubicMeterTolerance); AssertEx.EqualTolerance(1, PowerDensity.FromPicowattsPerCubicFoot(wattpercubicmeter.PicowattsPerCubicFoot).WattsPerCubicMeter, PicowattsPerCubicFootTolerance); AssertEx.EqualTolerance(1, PowerDensity.FromPicowattsPerCubicInch(wattpercubicmeter.PicowattsPerCubicInch).WattsPerCubicMeter, PicowattsPerCubicInchTolerance); AssertEx.EqualTolerance(1, PowerDensity.FromPicowattsPerCubicMeter(wattpercubicmeter.PicowattsPerCubicMeter).WattsPerCubicMeter, PicowattsPerCubicMeterTolerance); diff --git a/UnitsNet/GeneratedCode/Extensions/Number/NumberToPowerDensityExtensions.g.cs b/UnitsNet/GeneratedCode/Extensions/Number/NumberToPowerDensityExtensions.g.cs index e4ce1c4b70..c421ff6fb1 100644 --- a/UnitsNet/GeneratedCode/Extensions/Number/NumberToPowerDensityExtensions.g.cs +++ b/UnitsNet/GeneratedCode/Extensions/Number/NumberToPowerDensityExtensions.g.cs @@ -316,40 +316,6 @@ public static class NumberToPowerDensityExtensions #endregion - #region FemtowattPerCubicMeter - - /// - public static PowerDensity FemtowattsPerCubicMeter(this int value) => PowerDensity.FromFemtowattsPerCubicMeter(value); - - /// - public static PowerDensity? FemtowattsPerCubicMeter(this int? value) => PowerDensity.FromFemtowattsPerCubicMeter(value); - - /// - public static PowerDensity FemtowattsPerCubicMeter(this long value) => PowerDensity.FromFemtowattsPerCubicMeter(value); - - /// - public static PowerDensity? FemtowattsPerCubicMeter(this long? value) => PowerDensity.FromFemtowattsPerCubicMeter(value); - - /// - public static PowerDensity FemtowattsPerCubicMeter(this double value) => PowerDensity.FromFemtowattsPerCubicMeter(value); - - /// - public static PowerDensity? FemtowattsPerCubicMeter(this double? value) => PowerDensity.FromFemtowattsPerCubicMeter(value); - - /// - public static PowerDensity FemtowattsPerCubicMeter(this float value) => PowerDensity.FromFemtowattsPerCubicMeter(value); - - /// - public static PowerDensity? FemtowattsPerCubicMeter(this float? value) => PowerDensity.FromFemtowattsPerCubicMeter(value); - - /// - public static PowerDensity FemtowattsPerCubicMeter(this decimal value) => PowerDensity.FromFemtowattsPerCubicMeter(Convert.ToDouble(value)); - - /// - public static PowerDensity? FemtowattsPerCubicMeter(this decimal? value) => PowerDensity.FromFemtowattsPerCubicMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - #region GigawattPerCubicFoot /// @@ -1166,40 +1132,6 @@ public static class NumberToPowerDensityExtensions #endregion - #region PetawattPerCubicMeter - - /// - public static PowerDensity PetawattsPerCubicMeter(this int value) => PowerDensity.FromPetawattsPerCubicMeter(value); - - /// - public static PowerDensity? PetawattsPerCubicMeter(this int? value) => PowerDensity.FromPetawattsPerCubicMeter(value); - - /// - public static PowerDensity PetawattsPerCubicMeter(this long value) => PowerDensity.FromPetawattsPerCubicMeter(value); - - /// - public static PowerDensity? PetawattsPerCubicMeter(this long? value) => PowerDensity.FromPetawattsPerCubicMeter(value); - - /// - public static PowerDensity PetawattsPerCubicMeter(this double value) => PowerDensity.FromPetawattsPerCubicMeter(value); - - /// - public static PowerDensity? PetawattsPerCubicMeter(this double? value) => PowerDensity.FromPetawattsPerCubicMeter(value); - - /// - public static PowerDensity PetawattsPerCubicMeter(this float value) => PowerDensity.FromPetawattsPerCubicMeter(value); - - /// - public static PowerDensity? PetawattsPerCubicMeter(this float? value) => PowerDensity.FromPetawattsPerCubicMeter(value); - - /// - public static PowerDensity PetawattsPerCubicMeter(this decimal value) => PowerDensity.FromPetawattsPerCubicMeter(Convert.ToDouble(value)); - - /// - public static PowerDensity? PetawattsPerCubicMeter(this decimal? value) => PowerDensity.FromPetawattsPerCubicMeter(value == null ? (double?)null : Convert.ToDouble(value.Value)); - - #endregion - #region PicowattPerCubicFoot /// diff --git a/UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs index 564aa06e7a..5fdbbeeb75 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs @@ -195,10 +195,6 @@ public PowerDensity(double wattspercubicmeter) /// public double DeciwattsPerLiter => As(PowerDensityUnit.DeciwattPerLiter); /// - /// Get PowerDensity in FemtowattsPerCubicMeter. - /// - public double FemtowattsPerCubicMeter => As(PowerDensityUnit.FemtowattPerCubicMeter); - /// /// Get PowerDensity in GigawattsPerCubicFoot. /// public double GigawattsPerCubicFoot => As(PowerDensityUnit.GigawattPerCubicFoot); @@ -295,10 +291,6 @@ public PowerDensity(double wattspercubicmeter) /// public double NanowattsPerLiter => As(PowerDensityUnit.NanowattPerLiter); /// - /// Get PowerDensity in PetawattsPerCubicMeter. - /// - public double PetawattsPerCubicMeter => As(PowerDensityUnit.PetawattPerCubicMeter); - /// /// Get PowerDensity in PicowattsPerCubicFoot. /// public double PicowattsPerCubicFoot => As(PowerDensityUnit.PicowattPerCubicFoot); @@ -465,20 +457,6 @@ public static PowerDensity FromDeciwattsPerLiter(QuantityValue deciwattsperliter return new PowerDensity(value, PowerDensityUnit.DeciwattPerLiter); } - /// - /// Get PowerDensity from FemtowattsPerCubicMeter. - /// -#if WINDOWS_UWP - [Windows.Foundation.Metadata.DefaultOverload] - public static PowerDensity FromFemtowattsPerCubicMeter(double femtowattspercubicmeter) -#else - public static PowerDensity FromFemtowattsPerCubicMeter(QuantityValue femtowattspercubicmeter) -#endif - { - double value = (double) femtowattspercubicmeter; - return new PowerDensity(value, PowerDensityUnit.FemtowattPerCubicMeter); - } - /// /// Get PowerDensity from GigawattsPerCubicFoot. /// @@ -815,20 +793,6 @@ public static PowerDensity FromNanowattsPerLiter(QuantityValue nanowattsperliter return new PowerDensity(value, PowerDensityUnit.NanowattPerLiter); } - /// - /// Get PowerDensity from PetawattsPerCubicMeter. - /// -#if WINDOWS_UWP - [Windows.Foundation.Metadata.DefaultOverload] - public static PowerDensity FromPetawattsPerCubicMeter(double petawattspercubicmeter) -#else - public static PowerDensity FromPetawattsPerCubicMeter(QuantityValue petawattspercubicmeter) -#endif - { - double value = (double) petawattspercubicmeter; - return new PowerDensity(value, PowerDensityUnit.PetawattPerCubicMeter); - } - /// /// Get PowerDensity from PicowattsPerCubicFoot. /// @@ -1119,21 +1083,6 @@ public static PowerDensity FromWattsPerLiter(QuantityValue wattsperliter) } } - /// - /// Get nullable PowerDensity from nullable FemtowattsPerCubicMeter. - /// - public static PowerDensity? FromFemtowattsPerCubicMeter(QuantityValue? femtowattspercubicmeter) - { - if (femtowattspercubicmeter.HasValue) - { - return FromFemtowattsPerCubicMeter(femtowattspercubicmeter.Value); - } - else - { - return null; - } - } - /// /// Get nullable PowerDensity from nullable GigawattsPerCubicFoot. /// @@ -1494,21 +1443,6 @@ public static PowerDensity FromWattsPerLiter(QuantityValue wattsperliter) } } - /// - /// Get nullable PowerDensity from nullable PetawattsPerCubicMeter. - /// - public static PowerDensity? FromPetawattsPerCubicMeter(QuantityValue? petawattspercubicmeter) - { - if (petawattspercubicmeter.HasValue) - { - return FromPetawattsPerCubicMeter(petawattspercubicmeter.Value); - } - else - { - return null; - } - } - /// /// Get nullable PowerDensity from nullable PicowattsPerCubicFoot. /// @@ -1943,7 +1877,6 @@ public double As(PowerDensityUnit unit) case PowerDensityUnit.DeciwattPerCubicInch: return (baseUnitValue/6.102374409473228e4) / 1e-1d; case PowerDensityUnit.DeciwattPerCubicMeter: return (baseUnitValue) / 1e-1d; case PowerDensityUnit.DeciwattPerLiter: return (baseUnitValue/1.0e3) / 1e-1d; - case PowerDensityUnit.FemtowattPerCubicMeter: return (baseUnitValue) / 1e-15d; case PowerDensityUnit.GigawattPerCubicFoot: return (baseUnitValue/3.531466672148859e1) / 1e9d; case PowerDensityUnit.GigawattPerCubicInch: return (baseUnitValue/6.102374409473228e4) / 1e9d; case PowerDensityUnit.GigawattPerCubicMeter: return (baseUnitValue) / 1e9d; @@ -1968,7 +1901,6 @@ public double As(PowerDensityUnit unit) case PowerDensityUnit.NanowattPerCubicInch: return (baseUnitValue/6.102374409473228e4) / 1e-9d; case PowerDensityUnit.NanowattPerCubicMeter: return (baseUnitValue) / 1e-9d; case PowerDensityUnit.NanowattPerLiter: return (baseUnitValue/1.0e3) / 1e-9d; - case PowerDensityUnit.PetawattPerCubicMeter: return (baseUnitValue) / 1e15d; case PowerDensityUnit.PicowattPerCubicFoot: return (baseUnitValue/3.531466672148859e1) / 1e-12d; case PowerDensityUnit.PicowattPerCubicInch: return (baseUnitValue/6.102374409473228e4) / 1e-12d; case PowerDensityUnit.PicowattPerCubicMeter: return (baseUnitValue) / 1e-12d; @@ -2352,7 +2284,6 @@ private double AsBaseUnitWattsPerCubicMeter() case PowerDensityUnit.DeciwattPerCubicInch: return (_value*6.102374409473228e4) * 1e-1d; case PowerDensityUnit.DeciwattPerCubicMeter: return (_value) * 1e-1d; case PowerDensityUnit.DeciwattPerLiter: return (_value*1.0e3) * 1e-1d; - case PowerDensityUnit.FemtowattPerCubicMeter: return (_value) * 1e-15d; case PowerDensityUnit.GigawattPerCubicFoot: return (_value*3.531466672148859e1) * 1e9d; case PowerDensityUnit.GigawattPerCubicInch: return (_value*6.102374409473228e4) * 1e9d; case PowerDensityUnit.GigawattPerCubicMeter: return (_value) * 1e9d; @@ -2377,7 +2308,6 @@ private double AsBaseUnitWattsPerCubicMeter() case PowerDensityUnit.NanowattPerCubicInch: return (_value*6.102374409473228e4) * 1e-9d; case PowerDensityUnit.NanowattPerCubicMeter: return (_value) * 1e-9d; case PowerDensityUnit.NanowattPerLiter: return (_value*1.0e3) * 1e-9d; - case PowerDensityUnit.PetawattPerCubicMeter: return (_value) * 1e15d; case PowerDensityUnit.PicowattPerCubicFoot: return (_value*3.531466672148859e1) * 1e-12d; case PowerDensityUnit.PicowattPerCubicInch: return (_value*6.102374409473228e4) * 1e-12d; case PowerDensityUnit.PicowattPerCubicMeter: return (_value) * 1e-12d; diff --git a/UnitsNet/GeneratedCode/UnitSystem.Default.g.cs b/UnitsNet/GeneratedCode/UnitSystem.Default.g.cs index 8719f9feed..4d303080ba 100644 --- a/UnitsNet/GeneratedCode/UnitSystem.Default.g.cs +++ b/UnitsNet/GeneratedCode/UnitSystem.Default.g.cs @@ -2964,11 +2964,6 @@ private static readonly ReadOnlyCollection DefaultLocalization { new AbbreviationsForCulture("en-US", "dW/l"), }), - new CulturesForEnumValue((int) PowerDensityUnit.FemtowattPerCubicMeter, - new[] - { - new AbbreviationsForCulture("en-US", "fW/m³"), - }), new CulturesForEnumValue((int) PowerDensityUnit.GigawattPerCubicFoot, new[] { @@ -3089,11 +3084,6 @@ private static readonly ReadOnlyCollection DefaultLocalization { new AbbreviationsForCulture("en-US", "nW/l"), }), - new CulturesForEnumValue((int) PowerDensityUnit.PetawattPerCubicMeter, - new[] - { - new AbbreviationsForCulture("en-US", "PW/m³"), - }), new CulturesForEnumValue((int) PowerDensityUnit.PicowattPerCubicFoot, new[] { diff --git a/UnitsNet/GeneratedCode/Units/PowerDensityUnit.g.cs b/UnitsNet/GeneratedCode/Units/PowerDensityUnit.g.cs index e0946028c2..3763f0bd70 100644 --- a/UnitsNet/GeneratedCode/Units/PowerDensityUnit.g.cs +++ b/UnitsNet/GeneratedCode/Units/PowerDensityUnit.g.cs @@ -50,7 +50,6 @@ public enum PowerDensityUnit DeciwattPerCubicInch, DeciwattPerCubicMeter, DeciwattPerLiter, - FemtowattPerCubicMeter, GigawattPerCubicFoot, GigawattPerCubicInch, GigawattPerCubicMeter, @@ -75,7 +74,6 @@ public enum PowerDensityUnit NanowattPerCubicInch, NanowattPerCubicMeter, NanowattPerLiter, - PetawattPerCubicMeter, PicowattPerCubicFoot, PicowattPerCubicInch, PicowattPerCubicMeter, diff --git a/UnitsNet/UnitDefinitions/PowerDensity.json b/UnitsNet/UnitDefinitions/PowerDensity.json index e4174fe390..67d7230c17 100644 --- a/UnitsNet/UnitDefinitions/PowerDensity.json +++ b/UnitsNet/UnitDefinitions/PowerDensity.json @@ -8,7 +8,7 @@ "PluralName": "WattsPerCubicMeter", "FromUnitToBaseFunc": "x", "FromBaseToUnitFunc": "x", - "Prefixes": [ "Femto", "Pico", "Nano", "Micro", "Milli", "Deci", "Deca", "Kilo", "Mega", "Giga", "Tera", "Peta" ], + "Prefixes": [ "Pico", "Nano", "Micro", "Milli", "Deci", "Deca", "Kilo", "Mega", "Giga", "Tera" ], "Localization": [ { "Culture": "en-US", From 2ac0600d928c93332d7a7c770b95bf1ce4ff3716 Mon Sep 17 00:00:00 2001 From: Tristan Milnthorp Date: Thu, 21 Jun 2018 15:31:49 -0400 Subject: [PATCH 07/19] Adding documentation and parameter checks --- UnitsNet/Comparison.cs | 62 +++++++++++++++---- .../Quantities/Acceleration.g.cs | 6 +- .../Quantities/AmountOfSubstance.g.cs | 6 +- .../Quantities/AmplitudeRatio.g.cs | 6 +- UnitsNet/GeneratedCode/Quantities/Angle.g.cs | 6 +- .../Quantities/ApparentEnergy.g.cs | 6 +- .../Quantities/ApparentPower.g.cs | 6 +- UnitsNet/GeneratedCode/Quantities/Area.g.cs | 6 +- .../GeneratedCode/Quantities/AreaDensity.g.cs | 6 +- .../Quantities/AreaMomentOfInertia.g.cs | 6 +- .../GeneratedCode/Quantities/BitRate.g.cs | 6 +- .../BrakeSpecificFuelConsumption.g.cs | 6 +- .../GeneratedCode/Quantities/Capacitance.g.cs | 6 +- .../GeneratedCode/Quantities/Density.g.cs | 6 +- .../GeneratedCode/Quantities/Duration.g.cs | 6 +- .../Quantities/DynamicViscosity.g.cs | 6 +- .../Quantities/ElectricAdmittance.g.cs | 6 +- .../Quantities/ElectricCharge.g.cs | 6 +- .../Quantities/ElectricChargeDensity.g.cs | 6 +- .../Quantities/ElectricConductance.g.cs | 6 +- .../Quantities/ElectricConductivity.g.cs | 6 +- .../Quantities/ElectricCurrent.g.cs | 6 +- .../Quantities/ElectricCurrentDensity.g.cs | 6 +- .../Quantities/ElectricCurrentGradient.g.cs | 6 +- .../Quantities/ElectricField.g.cs | 6 +- .../Quantities/ElectricInductance.g.cs | 6 +- .../Quantities/ElectricPotential.g.cs | 6 +- .../Quantities/ElectricPotentialAc.g.cs | 6 +- .../Quantities/ElectricPotentialDc.g.cs | 6 +- .../Quantities/ElectricResistance.g.cs | 6 +- .../Quantities/ElectricResistivity.g.cs | 6 +- UnitsNet/GeneratedCode/Quantities/Energy.g.cs | 6 +- .../GeneratedCode/Quantities/Entropy.g.cs | 6 +- UnitsNet/GeneratedCode/Quantities/Flow.g.cs | 6 +- UnitsNet/GeneratedCode/Quantities/Force.g.cs | 6 +- .../Quantities/ForceChangeRate.g.cs | 6 +- .../Quantities/ForcePerLength.g.cs | 6 +- .../GeneratedCode/Quantities/Frequency.g.cs | 6 +- .../GeneratedCode/Quantities/HeatFlux.g.cs | 6 +- .../Quantities/HeatTransferCoefficient.g.cs | 6 +- .../GeneratedCode/Quantities/Illuminance.g.cs | 6 +- .../GeneratedCode/Quantities/Information.g.cs | 6 +- .../GeneratedCode/Quantities/Irradiance.g.cs | 6 +- .../GeneratedCode/Quantities/Irradiation.g.cs | 6 +- .../Quantities/KinematicViscosity.g.cs | 6 +- .../GeneratedCode/Quantities/LapseRate.g.cs | 6 +- UnitsNet/GeneratedCode/Quantities/Length.g.cs | 6 +- UnitsNet/GeneratedCode/Quantities/Level.g.cs | 6 +- .../Quantities/LinearDensity.g.cs | 6 +- .../Quantities/LuminousFlux.g.cs | 6 +- .../Quantities/LuminousIntensity.g.cs | 6 +- .../Quantities/MagneticField.g.cs | 6 +- .../Quantities/MagneticFlux.g.cs | 6 +- .../Quantities/Magnetization.g.cs | 6 +- UnitsNet/GeneratedCode/Quantities/Mass.g.cs | 6 +- .../GeneratedCode/Quantities/MassFlow.g.cs | 6 +- .../GeneratedCode/Quantities/MassFlux.g.cs | 6 +- .../Quantities/MassMomentOfInertia.g.cs | 6 +- .../GeneratedCode/Quantities/MolarEnergy.g.cs | 6 +- .../Quantities/MolarEntropy.g.cs | 6 +- .../GeneratedCode/Quantities/MolarMass.g.cs | 6 +- .../GeneratedCode/Quantities/Molarity.g.cs | 6 +- .../Quantities/Permeability.g.cs | 6 +- .../Quantities/Permittivity.g.cs | 6 +- UnitsNet/GeneratedCode/Quantities/Power.g.cs | 6 +- .../Quantities/PowerDensity.g.cs | 6 +- .../GeneratedCode/Quantities/PowerRatio.g.cs | 6 +- .../GeneratedCode/Quantities/Pressure.g.cs | 6 +- .../Quantities/PressureChangeRate.g.cs | 6 +- UnitsNet/GeneratedCode/Quantities/Ratio.g.cs | 6 +- .../Quantities/ReactiveEnergy.g.cs | 6 +- .../Quantities/ReactivePower.g.cs | 6 +- .../Quantities/RotationalAcceleration.g.cs | 6 +- .../Quantities/RotationalSpeed.g.cs | 6 +- .../Quantities/RotationalStiffness.g.cs | 6 +- .../RotationalStiffnessPerLength.g.cs | 6 +- .../GeneratedCode/Quantities/SolidAngle.g.cs | 6 +- .../Quantities/SpecificEnergy.g.cs | 6 +- .../Quantities/SpecificEntropy.g.cs | 6 +- .../Quantities/SpecificVolume.g.cs | 6 +- .../Quantities/SpecificWeight.g.cs | 6 +- UnitsNet/GeneratedCode/Quantities/Speed.g.cs | 6 +- .../GeneratedCode/Quantities/Temperature.g.cs | 6 +- .../Quantities/TemperatureChangeRate.g.cs | 6 +- .../Quantities/TemperatureDelta.g.cs | 6 +- .../Quantities/ThermalConductivity.g.cs | 6 +- .../Quantities/ThermalResistance.g.cs | 6 +- UnitsNet/GeneratedCode/Quantities/Torque.g.cs | 6 +- .../GeneratedCode/Quantities/VitaminA.g.cs | 6 +- UnitsNet/GeneratedCode/Quantities/Volume.g.cs | 6 +- .../GeneratedCode/Quantities/VolumeFlow.g.cs | 6 +- .../Include-GenerateQuantitySourceCode.ps1 | 6 +- 92 files changed, 505 insertions(+), 103 deletions(-) diff --git a/UnitsNet/Comparison.cs b/UnitsNet/Comparison.cs index c2beb777c2..8cbf54279d 100644 --- a/UnitsNet/Comparison.cs +++ b/UnitsNet/Comparison.cs @@ -25,25 +25,63 @@ namespace UnitsNet { public sealed class Comparison { - public static bool Equals( double value1, double value2, double tolerance, ComparisonType comparisonType) + /// + /// Checks if two values are equal with a given relative or absolute tolerance. + /// Relative tolerance is when the difference between the two values is not greater than referenceValue * tolerance. + /// Absolute tolerance is when the absolute difference between the two values is not greater than the tolerance value. + /// + /// The first value. If using relative tolerance, it is the value which the relative tolerance will be calculated against. + /// The value to compare to. + /// The absolute or relative tolerance value. + /// Whether to use tolerance as an absolute or relative tolerance. + /// + public static bool Equals(double referenceValue, double value, double tolerance, ComparisonType comparisonType) { - if(comparisonType == ComparisonType.Relative) - return EqualsRelative(value1, value2, tolerance); - else if(comparisonType == ComparisonType.Absolute) - return EqualsAbsolute(value1, value2, tolerance); - else - throw new InvalidOperationException("The ComparisonType is unsupported."); + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + + switch(comparisonType) + { + case ComparisonType.Relative: + return EqualsRelative(referenceValue, value, tolerance); + case ComparisonType.Absolute: + return EqualsAbsolute(referenceValue, value, tolerance); + default: + throw new InvalidOperationException("The given ComparisonType is not supported."); + } } - public static bool EqualsRelative( double value1, double value2, double tolerance) + /// + /// Checks if two values are equal with a given relative tolerance. The relative tolerance is calculated against the referenceValue parameter. + /// Relative tolerance is when the difference between the two values is not greater than referenceValue * tolerance. + /// + /// The reference value which the tolerance will be calculated against. + /// The value to compare to. + /// + /// True if the two values are equal within the given relative tolerance, otherwise false. + public static bool EqualsRelative(double referenceValue, double value, double tolerance) { - double maxVariation = Math.Abs( value1 * tolerance ); - return Math.Abs( value1 - value2 ) <= maxVariation; + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + + double maxVariation = Math.Abs(referenceValue * tolerance); + return Math.Abs(referenceValue - value) <= maxVariation; } - public static bool EqualsAbsolute( double value1, double value2, double tolerance) + /// + /// Checks if two values are equal with a given absolute tolerance. + /// Absolute tolerance is when the absolute difference between the two values is not greater than the tolerance value. + /// + /// The first value. + /// The second value. + /// The absolute tolerance. This is the maxinum allowable absolute difference between the two values. Must be greater than 0. + /// True if the two values are equal within the given absolute tolerance, otherwise false. + public static bool EqualsAbsolute(double value1, double value2, double tolerance) { - return Math.Abs( value1 - value2 ) <= tolerance; + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + + return Math.Abs(value1 - value2) <= tolerance; } } } diff --git a/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs b/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs index 53bce1592e..a61c84eccb 100644 --- a/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs @@ -793,7 +793,8 @@ public override bool Equals(object obj) /// /// Compare equality to another Acceleration within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -803,6 +804,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Acceleration other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitMetersPerSecondSquared(); double otherBaseValue = (double)other.AsBaseUnitMetersPerSecondSquared(); diff --git a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs index 20827f9a18..a7ee0dddd2 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs @@ -826,7 +826,8 @@ public override bool Equals(object obj) /// /// Compare equality to another AmountOfSubstance within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -836,6 +837,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(AmountOfSubstance other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitMoles(); double otherBaseValue = (double)other.AsBaseUnitMoles(); diff --git a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs index 962d551d1a..043ac6b24f 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs @@ -504,7 +504,8 @@ public override bool Equals(object obj) /// /// Compare equality to another AmplitudeRatio within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -514,6 +515,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(AmplitudeRatio other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitDecibelVolts(); double otherBaseValue = (double)other.AsBaseUnitDecibelVolts(); diff --git a/UnitsNet/GeneratedCode/Quantities/Angle.g.cs b/UnitsNet/GeneratedCode/Quantities/Angle.g.cs index 29c802d116..a6a988bc33 100644 --- a/UnitsNet/GeneratedCode/Quantities/Angle.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Angle.g.cs @@ -826,7 +826,8 @@ public override bool Equals(object obj) /// /// Compare equality to another Angle within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -836,6 +837,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Angle other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitDegrees(); double otherBaseValue = (double)other.AsBaseUnitDegrees(); diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs index 0584e51fbd..6414425bb4 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs @@ -463,7 +463,8 @@ public override bool Equals(object obj) /// /// Compare equality to another ApparentEnergy within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -473,6 +474,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ApparentEnergy other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitVoltampereHours(); double otherBaseValue = (double)other.AsBaseUnitVoltampereHours(); diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs index 15ce79b6fb..7993d5a6f3 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs @@ -496,7 +496,8 @@ public override bool Equals(object obj) /// /// Compare equality to another ApparentPower within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -506,6 +507,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ApparentPower other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitVoltamperes(); double otherBaseValue = (double)other.AsBaseUnitVoltamperes(); diff --git a/UnitsNet/GeneratedCode/Quantities/Area.g.cs b/UnitsNet/GeneratedCode/Quantities/Area.g.cs index 57b47d3e87..2294d5e5fa 100644 --- a/UnitsNet/GeneratedCode/Quantities/Area.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Area.g.cs @@ -793,7 +793,8 @@ public override bool Equals(object obj) /// /// Compare equality to another Area within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -803,6 +804,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Area other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitSquareMeters(); double otherBaseValue = (double)other.AsBaseUnitSquareMeters(); diff --git a/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs index beb2dc5ab5..9d97a83bda 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs @@ -397,7 +397,8 @@ public override bool Equals(object obj) /// /// Compare equality to another AreaDensity within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -407,6 +408,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(AreaDensity other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitKilogramsPerSquareMeter(); double otherBaseValue = (double)other.AsBaseUnitKilogramsPerSquareMeter(); diff --git a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs index 7b4ea19ae4..b32d8ae6b5 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs @@ -562,7 +562,8 @@ public override bool Equals(object obj) /// /// Compare equality to another AreaMomentOfInertia within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -572,6 +573,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(AreaMomentOfInertia other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitMetersToTheFourth(); double otherBaseValue = (double)other.AsBaseUnitMetersToTheFourth(); diff --git a/UnitsNet/GeneratedCode/Quantities/BitRate.g.cs b/UnitsNet/GeneratedCode/Quantities/BitRate.g.cs index abf77d136b..d5849f2336 100644 --- a/UnitsNet/GeneratedCode/Quantities/BitRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BitRate.g.cs @@ -1219,7 +1219,8 @@ public override bool Equals(object obj) /// /// Compare equality to another BitRate within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -1229,6 +1230,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(BitRate other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitBitsPerSecond(); double otherBaseValue = (double)other.AsBaseUnitBitsPerSecond(); diff --git a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs index 4424e1349a..4537ec2560 100644 --- a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs @@ -463,7 +463,8 @@ public override bool Equals(object obj) /// /// Compare equality to another BrakeSpecificFuelConsumption within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -473,6 +474,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(BrakeSpecificFuelConsumption other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitKilogramsPerJoule(); double otherBaseValue = (double)other.AsBaseUnitKilogramsPerJoule(); diff --git a/UnitsNet/GeneratedCode/Quantities/Capacitance.g.cs b/UnitsNet/GeneratedCode/Quantities/Capacitance.g.cs index 2e64a5a74e..e52e2cdc0a 100644 --- a/UnitsNet/GeneratedCode/Quantities/Capacitance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Capacitance.g.cs @@ -397,7 +397,8 @@ public override bool Equals(object obj) /// /// Compare equality to another Capacitance within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -407,6 +408,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Capacitance other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitFarads(); double otherBaseValue = (double)other.AsBaseUnitFarads(); diff --git a/UnitsNet/GeneratedCode/Quantities/Density.g.cs b/UnitsNet/GeneratedCode/Quantities/Density.g.cs index 53df2c3763..accbd6363a 100644 --- a/UnitsNet/GeneratedCode/Quantities/Density.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Density.g.cs @@ -1618,7 +1618,8 @@ public override bool Equals(object obj) /// /// Compare equality to another Density within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -1628,6 +1629,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Density other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitKilogramsPerCubicMeter(); double otherBaseValue = (double)other.AsBaseUnitKilogramsPerCubicMeter(); diff --git a/UnitsNet/GeneratedCode/Quantities/Duration.g.cs b/UnitsNet/GeneratedCode/Quantities/Duration.g.cs index 3c4ad8f972..f0e937d913 100644 --- a/UnitsNet/GeneratedCode/Quantities/Duration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Duration.g.cs @@ -762,7 +762,8 @@ public override bool Equals(object obj) /// /// Compare equality to another Duration within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -772,6 +773,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Duration other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitSeconds(); double otherBaseValue = (double)other.AsBaseUnitSeconds(); diff --git a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs index 41778dfcf0..6211497e3a 100644 --- a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs @@ -562,7 +562,8 @@ public override bool Equals(object obj) /// /// Compare equality to another DynamicViscosity within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -572,6 +573,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(DynamicViscosity other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitNewtonSecondsPerMeterSquared(); double otherBaseValue = (double)other.AsBaseUnitNewtonSecondsPerMeterSquared(); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs index 886f6adc55..304dbfe451 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs @@ -496,7 +496,8 @@ public override bool Equals(object obj) /// /// Compare equality to another ElectricAdmittance within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -506,6 +507,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ElectricAdmittance other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitSiemens(); double otherBaseValue = (double)other.AsBaseUnitSiemens(); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs index 2066d09f39..b41d13e4e5 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs @@ -397,7 +397,8 @@ public override bool Equals(object obj) /// /// Compare equality to another ElectricCharge within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -407,6 +408,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ElectricCharge other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitCoulombs(); double otherBaseValue = (double)other.AsBaseUnitCoulombs(); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs index c363e2b5f5..eb24a37a2a 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs @@ -397,7 +397,8 @@ public override bool Equals(object obj) /// /// Compare equality to another ElectricChargeDensity within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -407,6 +408,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ElectricChargeDensity other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitCoulombsPerCubicMeter(); double otherBaseValue = (double)other.AsBaseUnitCoulombsPerCubicMeter(); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs index ce1f25b946..227c0bf08f 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs @@ -463,7 +463,8 @@ public override bool Equals(object obj) /// /// Compare equality to another ElectricConductance within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -473,6 +474,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ElectricConductance other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitSiemens(); double otherBaseValue = (double)other.AsBaseUnitSiemens(); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs index 8e4eeb2807..aeb21b4dc3 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs @@ -397,7 +397,8 @@ public override bool Equals(object obj) /// /// Compare equality to another ElectricConductivity within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -407,6 +408,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ElectricConductivity other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitSiemensPerMeter(); double otherBaseValue = (double)other.AsBaseUnitSiemensPerMeter(); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs index 7d1fc25dbf..45125c9d5e 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs @@ -595,7 +595,8 @@ public override bool Equals(object obj) /// /// Compare equality to another ElectricCurrent within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -605,6 +606,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ElectricCurrent other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitAmperes(); double otherBaseValue = (double)other.AsBaseUnitAmperes(); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs index 3c25590237..13d861b0c5 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs @@ -397,7 +397,8 @@ public override bool Equals(object obj) /// /// Compare equality to another ElectricCurrentDensity within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -407,6 +408,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ElectricCurrentDensity other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitAmperesPerSquareMeter(); double otherBaseValue = (double)other.AsBaseUnitAmperesPerSquareMeter(); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs index edc36f71c8..937bbdb62d 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs @@ -397,7 +397,8 @@ public override bool Equals(object obj) /// /// Compare equality to another ElectricCurrentGradient within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -407,6 +408,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ElectricCurrentGradient other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitAmperesPerSecond(); double otherBaseValue = (double)other.AsBaseUnitAmperesPerSecond(); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs index 604a522672..81d05b1a9d 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs @@ -397,7 +397,8 @@ public override bool Equals(object obj) /// /// Compare equality to another ElectricField within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -407,6 +408,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ElectricField other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitVoltsPerMeter(); double otherBaseValue = (double)other.AsBaseUnitVoltsPerMeter(); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs index cb25400055..9b70f6cc94 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs @@ -397,7 +397,8 @@ public override bool Equals(object obj) /// /// Compare equality to another ElectricInductance within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -407,6 +408,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ElectricInductance other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitHenries(); double otherBaseValue = (double)other.AsBaseUnitHenries(); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs index e01ea2d49f..37a0957965 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs @@ -529,7 +529,8 @@ public override bool Equals(object obj) /// /// Compare equality to another ElectricPotential within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -539,6 +540,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ElectricPotential other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitVolts(); double otherBaseValue = (double)other.AsBaseUnitVolts(); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.g.cs index f4d900d97f..65e331a033 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.g.cs @@ -529,7 +529,8 @@ public override bool Equals(object obj) /// /// Compare equality to another ElectricPotentialAc within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -539,6 +540,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ElectricPotentialAc other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitVoltsAc(); double otherBaseValue = (double)other.AsBaseUnitVoltsAc(); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.g.cs index 022a23ce8d..48fa109d6e 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.g.cs @@ -529,7 +529,8 @@ public override bool Equals(object obj) /// /// Compare equality to another ElectricPotentialDc within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -539,6 +540,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ElectricPotentialDc other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitVoltsDc(); double otherBaseValue = (double)other.AsBaseUnitVoltsDc(); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs index 5beebe7307..9512388a10 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs @@ -496,7 +496,8 @@ public override bool Equals(object obj) /// /// Compare equality to another ElectricResistance within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -506,6 +507,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ElectricResistance other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitOhms(); double otherBaseValue = (double)other.AsBaseUnitOhms(); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs index 6e5dc17825..91a2418fa5 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs @@ -496,7 +496,8 @@ public override bool Equals(object obj) /// /// Compare equality to another ElectricResistivity within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -506,6 +507,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ElectricResistivity other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitOhmMeters(); double otherBaseValue = (double)other.AsBaseUnitOhmMeters(); diff --git a/UnitsNet/GeneratedCode/Quantities/Energy.g.cs b/UnitsNet/GeneratedCode/Quantities/Energy.g.cs index e4fb555f2b..3988c62599 100644 --- a/UnitsNet/GeneratedCode/Quantities/Energy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Energy.g.cs @@ -1090,7 +1090,8 @@ public override bool Equals(object obj) /// /// Compare equality to another Energy within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -1100,6 +1101,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Energy other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitJoules(); double otherBaseValue = (double)other.AsBaseUnitJoules(); diff --git a/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs b/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs index e520934bf7..7f656371bd 100644 --- a/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs @@ -595,7 +595,8 @@ public override bool Equals(object obj) /// /// Compare equality to another Entropy within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -605,6 +606,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Entropy other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitJoulesPerKelvin(); double otherBaseValue = (double)other.AsBaseUnitJoulesPerKelvin(); diff --git a/UnitsNet/GeneratedCode/Quantities/Flow.g.cs b/UnitsNet/GeneratedCode/Quantities/Flow.g.cs index d2b9abfd21..e7333961bc 100644 --- a/UnitsNet/GeneratedCode/Quantities/Flow.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Flow.g.cs @@ -1174,7 +1174,8 @@ public override bool Equals(object obj) /// /// Compare equality to another Flow within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -1184,6 +1185,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Flow other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitCubicMetersPerSecond(); double otherBaseValue = (double)other.AsBaseUnitCubicMetersPerSecond(); diff --git a/UnitsNet/GeneratedCode/Quantities/Force.g.cs b/UnitsNet/GeneratedCode/Quantities/Force.g.cs index dbbcf4e847..0eb4c9ba34 100644 --- a/UnitsNet/GeneratedCode/Quantities/Force.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Force.g.cs @@ -694,7 +694,8 @@ public override bool Equals(object obj) /// /// Compare equality to another Force within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -704,6 +705,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Force other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitNewtons(); double otherBaseValue = (double)other.AsBaseUnitNewtons(); diff --git a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs index 407d354007..a1c7c0f5b1 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs @@ -727,7 +727,8 @@ public override bool Equals(object obj) /// /// Compare equality to another ForceChangeRate within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -737,6 +738,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ForceChangeRate other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitNewtonsPerSecond(); double otherBaseValue = (double)other.AsBaseUnitNewtonsPerSecond(); diff --git a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs index 71bdb3ad89..8640c1e709 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs @@ -661,7 +661,8 @@ public override bool Equals(object obj) /// /// Compare equality to another ForcePerLength within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -671,6 +672,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ForcePerLength other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitNewtonsPerMeter(); double otherBaseValue = (double)other.AsBaseUnitNewtonsPerMeter(); diff --git a/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs b/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs index 0bfb03a09f..34f6619170 100644 --- a/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs @@ -628,7 +628,8 @@ public override bool Equals(object obj) /// /// Compare equality to another Frequency within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -638,6 +639,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Frequency other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitHertz(); double otherBaseValue = (double)other.AsBaseUnitHertz(); diff --git a/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs index 479bdfd97a..14731bcab4 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs @@ -892,7 +892,8 @@ public override bool Equals(object obj) /// /// Compare equality to another HeatFlux within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -902,6 +903,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(HeatFlux other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitWattsPerSquareMeter(); double otherBaseValue = (double)other.AsBaseUnitWattsPerSquareMeter(); diff --git a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs index 6a1754f698..e57d1c92b0 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs @@ -430,7 +430,8 @@ public override bool Equals(object obj) /// /// Compare equality to another HeatTransferCoefficient within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -440,6 +441,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(HeatTransferCoefficient other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitWattsPerSquareMeterKelvin(); double otherBaseValue = (double)other.AsBaseUnitWattsPerSquareMeterKelvin(); diff --git a/UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs b/UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs index 58e47c2ef3..80c5080919 100644 --- a/UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs @@ -496,7 +496,8 @@ public override bool Equals(object obj) /// /// Compare equality to another Illuminance within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -506,6 +507,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Illuminance other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitLux(); double otherBaseValue = (double)other.AsBaseUnitLux(); diff --git a/UnitsNet/GeneratedCode/Quantities/Information.g.cs b/UnitsNet/GeneratedCode/Quantities/Information.g.cs index a885e12a38..7033b45010 100644 --- a/UnitsNet/GeneratedCode/Quantities/Information.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Information.g.cs @@ -1219,7 +1219,8 @@ public override bool Equals(object obj) /// /// Compare equality to another Information within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -1229,6 +1230,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Information other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitBits(); double otherBaseValue = (double)other.AsBaseUnitBits(); diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs index 29384ec2a3..82796f8b70 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs @@ -430,7 +430,8 @@ public override bool Equals(object obj) /// /// Compare equality to another Irradiance within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -440,6 +441,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Irradiance other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitWattsPerSquareMeter(); double otherBaseValue = (double)other.AsBaseUnitWattsPerSquareMeter(); diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs index d32b652813..bde17ba01c 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs @@ -463,7 +463,8 @@ public override bool Equals(object obj) /// /// Compare equality to another Irradiation within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -473,6 +474,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Irradiation other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitJoulesPerSquareMeter(); double otherBaseValue = (double)other.AsBaseUnitJoulesPerSquareMeter(); diff --git a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs index 6d82161fa9..23421c1ff8 100644 --- a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs @@ -628,7 +628,8 @@ public override bool Equals(object obj) /// /// Compare equality to another KinematicViscosity within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -638,6 +639,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(KinematicViscosity other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitSquareMetersPerSecond(); double otherBaseValue = (double)other.AsBaseUnitSquareMetersPerSecond(); diff --git a/UnitsNet/GeneratedCode/Quantities/LapseRate.g.cs b/UnitsNet/GeneratedCode/Quantities/LapseRate.g.cs index d994576bb3..789518053b 100644 --- a/UnitsNet/GeneratedCode/Quantities/LapseRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LapseRate.g.cs @@ -397,7 +397,8 @@ public override bool Equals(object obj) /// /// Compare equality to another LapseRate within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -407,6 +408,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(LapseRate other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitDegreesCelciusPerKilometer(); double otherBaseValue = (double)other.AsBaseUnitDegreesCelciusPerKilometer(); diff --git a/UnitsNet/GeneratedCode/Quantities/Length.g.cs b/UnitsNet/GeneratedCode/Quantities/Length.g.cs index 4837089497..c25fe1787c 100644 --- a/UnitsNet/GeneratedCode/Quantities/Length.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Length.g.cs @@ -1090,7 +1090,8 @@ public override bool Equals(object obj) /// /// Compare equality to another Length within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -1100,6 +1101,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Length other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitMeters(); double otherBaseValue = (double)other.AsBaseUnitMeters(); diff --git a/UnitsNet/GeneratedCode/Quantities/Level.g.cs b/UnitsNet/GeneratedCode/Quantities/Level.g.cs index c8c4f2cecd..d47d45fa7b 100644 --- a/UnitsNet/GeneratedCode/Quantities/Level.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Level.g.cs @@ -438,7 +438,8 @@ public override bool Equals(object obj) /// /// Compare equality to another Level within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -448,6 +449,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Level other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitDecibels(); double otherBaseValue = (double)other.AsBaseUnitDecibels(); diff --git a/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs index c1ea0ecdb7..1bcfaab9d9 100644 --- a/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs @@ -463,7 +463,8 @@ public override bool Equals(object obj) /// /// Compare equality to another LinearDensity within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -473,6 +474,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(LinearDensity other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitKilogramsPerMeter(); double otherBaseValue = (double)other.AsBaseUnitKilogramsPerMeter(); diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.g.cs index eaae8d04c5..86b49c5120 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.g.cs @@ -397,7 +397,8 @@ public override bool Equals(object obj) /// /// Compare equality to another LuminousFlux within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -407,6 +408,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(LuminousFlux other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitLumens(); double otherBaseValue = (double)other.AsBaseUnitLumens(); diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs index 547631b29f..3134004973 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs @@ -397,7 +397,8 @@ public override bool Equals(object obj) /// /// Compare equality to another LuminousIntensity within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -407,6 +408,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(LuminousIntensity other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitCandela(); double otherBaseValue = (double)other.AsBaseUnitCandela(); diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticField.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticField.g.cs index 5337a53b8a..979ba90730 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticField.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticField.g.cs @@ -397,7 +397,8 @@ public override bool Equals(object obj) /// /// Compare equality to another MagneticField within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -407,6 +408,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(MagneticField other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitTeslas(); double otherBaseValue = (double)other.AsBaseUnitTeslas(); diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.g.cs index f387f7d869..fa0d7133b2 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.g.cs @@ -397,7 +397,8 @@ public override bool Equals(object obj) /// /// Compare equality to another MagneticFlux within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -407,6 +408,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(MagneticFlux other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitWebers(); double otherBaseValue = (double)other.AsBaseUnitWebers(); diff --git a/UnitsNet/GeneratedCode/Quantities/Magnetization.g.cs b/UnitsNet/GeneratedCode/Quantities/Magnetization.g.cs index 5ce99713ec..85b37b1877 100644 --- a/UnitsNet/GeneratedCode/Quantities/Magnetization.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Magnetization.g.cs @@ -397,7 +397,8 @@ public override bool Equals(object obj) /// /// Compare equality to another Magnetization within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -407,6 +408,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Magnetization other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitAmperesPerMeter(); double otherBaseValue = (double)other.AsBaseUnitAmperesPerMeter(); diff --git a/UnitsNet/GeneratedCode/Quantities/Mass.g.cs b/UnitsNet/GeneratedCode/Quantities/Mass.g.cs index d772945e67..8c60b07d1c 100644 --- a/UnitsNet/GeneratedCode/Quantities/Mass.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Mass.g.cs @@ -1057,7 +1057,8 @@ public override bool Equals(object obj) /// /// Compare equality to another Mass within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -1067,6 +1068,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Mass other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitKilograms(); double otherBaseValue = (double)other.AsBaseUnitKilograms(); diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs index 20e8b579db..393d967008 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs @@ -859,7 +859,8 @@ public override bool Equals(object obj) /// /// Compare equality to another MassFlow within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -869,6 +870,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(MassFlow other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitGramsPerSecond(); double otherBaseValue = (double)other.AsBaseUnitGramsPerSecond(); diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs index e282d1b6c3..d36e9d0a5c 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs @@ -430,7 +430,8 @@ public override bool Equals(object obj) /// /// Compare equality to another MassFlux within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -440,6 +441,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(MassFlux other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitKilogramsPerSecondPerSquareMeter(); double otherBaseValue = (double)other.AsBaseUnitKilogramsPerSecondPerSquareMeter(); diff --git a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.g.cs b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.g.cs index 29ca44f94f..82f6d38d34 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.g.cs @@ -1222,7 +1222,8 @@ public override bool Equals(object obj) /// /// Compare equality to another MassMomentOfInertia within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -1232,6 +1233,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(MassMomentOfInertia other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitKilogramSquareMeters(); double otherBaseValue = (double)other.AsBaseUnitKilogramSquareMeters(); diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.g.cs index 46be6f2bb6..01e1fd340b 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.g.cs @@ -463,7 +463,8 @@ public override bool Equals(object obj) /// /// Compare equality to another MolarEnergy within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -473,6 +474,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(MolarEnergy other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitJoulesPerMole(); double otherBaseValue = (double)other.AsBaseUnitJoulesPerMole(); diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.g.cs index e362c84eaa..c7fb5e73f9 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.g.cs @@ -463,7 +463,8 @@ public override bool Equals(object obj) /// /// Compare equality to another MolarEntropy within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -473,6 +474,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(MolarEntropy other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitJoulesPerMoleKelvin(); double otherBaseValue = (double)other.AsBaseUnitJoulesPerMoleKelvin(); diff --git a/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs index 86970fb796..3d4675e4c2 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs @@ -760,7 +760,8 @@ public override bool Equals(object obj) /// /// Compare equality to another MolarMass within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -770,6 +771,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(MolarMass other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitKilogramsPerMole(); double otherBaseValue = (double)other.AsBaseUnitKilogramsPerMole(); diff --git a/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs b/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs index 177fbc9424..43e923f34d 100644 --- a/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs @@ -628,7 +628,8 @@ public override bool Equals(object obj) /// /// Compare equality to another Molarity within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -638,6 +639,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Molarity other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitMolesPerCubicMeter(); double otherBaseValue = (double)other.AsBaseUnitMolesPerCubicMeter(); diff --git a/UnitsNet/GeneratedCode/Quantities/Permeability.g.cs b/UnitsNet/GeneratedCode/Quantities/Permeability.g.cs index 05c733c643..1a3b3fd28d 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permeability.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permeability.g.cs @@ -397,7 +397,8 @@ public override bool Equals(object obj) /// /// Compare equality to another Permeability within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -407,6 +408,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Permeability other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitHenriesPerMeter(); double otherBaseValue = (double)other.AsBaseUnitHenriesPerMeter(); diff --git a/UnitsNet/GeneratedCode/Quantities/Permittivity.g.cs b/UnitsNet/GeneratedCode/Quantities/Permittivity.g.cs index 955372cc5d..d670f53530 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permittivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permittivity.g.cs @@ -397,7 +397,8 @@ public override bool Equals(object obj) /// /// Compare equality to another Permittivity within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -407,6 +408,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Permittivity other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitFaradsPerMeter(); double otherBaseValue = (double)other.AsBaseUnitFaradsPerMeter(); diff --git a/UnitsNet/GeneratedCode/Quantities/Power.g.cs b/UnitsNet/GeneratedCode/Quantities/Power.g.cs index fbf738a5f1..aeb235deb3 100644 --- a/UnitsNet/GeneratedCode/Quantities/Power.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Power.g.cs @@ -1021,7 +1021,8 @@ public override bool Equals(object obj) /// /// Compare equality to another Power within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -1031,6 +1032,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Power other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitWatts(); double otherBaseValue = (double)other.AsBaseUnitWatts(); diff --git a/UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs index 5fdbbeeb75..c7b8aefd1d 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs @@ -1816,7 +1816,8 @@ public override bool Equals(object obj) /// /// Compare equality to another PowerDensity within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -1826,6 +1827,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(PowerDensity other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitWattsPerCubicMeter(); double otherBaseValue = (double)other.AsBaseUnitWattsPerCubicMeter(); diff --git a/UnitsNet/GeneratedCode/Quantities/PowerRatio.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerRatio.g.cs index 0705c903a3..d07877ba3d 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerRatio.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerRatio.g.cs @@ -438,7 +438,8 @@ public override bool Equals(object obj) /// /// Compare equality to another PowerRatio within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -448,6 +449,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(PowerRatio other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitDecibelWatts(); double otherBaseValue = (double)other.AsBaseUnitDecibelWatts(); diff --git a/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs b/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs index 2bf9e47c0a..7f22e09aec 100644 --- a/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs @@ -1619,7 +1619,8 @@ public override bool Equals(object obj) /// /// Compare equality to another Pressure within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -1629,6 +1630,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Pressure other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitPascals(); double otherBaseValue = (double)other.AsBaseUnitPascals(); diff --git a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs index 5027a7b2b3..71238a9005 100644 --- a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs @@ -496,7 +496,8 @@ public override bool Equals(object obj) /// /// Compare equality to another PressureChangeRate within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -506,6 +507,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(PressureChangeRate other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitPascalsPerSecond(); double otherBaseValue = (double)other.AsBaseUnitPascalsPerSecond(); diff --git a/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs b/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs index 553c4d4224..4bf8aae11e 100644 --- a/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs @@ -562,7 +562,8 @@ public override bool Equals(object obj) /// /// Compare equality to another Ratio within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -572,6 +573,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Ratio other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitDecimalFractions(); double otherBaseValue = (double)other.AsBaseUnitDecimalFractions(); diff --git a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.g.cs index d570a950ab..e9acd46514 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.g.cs @@ -463,7 +463,8 @@ public override bool Equals(object obj) /// /// Compare equality to another ReactiveEnergy within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -473,6 +474,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ReactiveEnergy other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitVoltampereReactiveHours(); double otherBaseValue = (double)other.AsBaseUnitVoltampereReactiveHours(); diff --git a/UnitsNet/GeneratedCode/Quantities/ReactivePower.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactivePower.g.cs index 95e809d8be..3f6ed5d974 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactivePower.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactivePower.g.cs @@ -496,7 +496,8 @@ public override bool Equals(object obj) /// /// Compare equality to another ReactivePower within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -506,6 +507,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ReactivePower other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitVoltamperesReactive(); double otherBaseValue = (double)other.AsBaseUnitVoltamperesReactive(); diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.g.cs index e067995b63..64343affc1 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.g.cs @@ -463,7 +463,8 @@ public override bool Equals(object obj) /// /// Compare equality to another RotationalAcceleration within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -473,6 +474,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(RotationalAcceleration other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitRadiansPerSecondSquared(); double otherBaseValue = (double)other.AsBaseUnitRadiansPerSecondSquared(); diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs index 4ebd0d98b7..79834a04e4 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs @@ -793,7 +793,8 @@ public override bool Equals(object obj) /// /// Compare equality to another RotationalSpeed within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -803,6 +804,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(RotationalSpeed other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitRadiansPerSecond(); double otherBaseValue = (double)other.AsBaseUnitRadiansPerSecond(); diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs index 4b2f7cd2a6..54b1b6f98a 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs @@ -463,7 +463,8 @@ public override bool Equals(object obj) /// /// Compare equality to another RotationalStiffness within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -473,6 +474,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(RotationalStiffness other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitNewtonMetersPerRadian(); double otherBaseValue = (double)other.AsBaseUnitNewtonMetersPerRadian(); diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs index dfb0e83bc0..a6a6399c03 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs @@ -463,7 +463,8 @@ public override bool Equals(object obj) /// /// Compare equality to another RotationalStiffnessPerLength within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -473,6 +474,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(RotationalStiffnessPerLength other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitNewtonMetersPerRadianPerMeter(); double otherBaseValue = (double)other.AsBaseUnitNewtonMetersPerRadianPerMeter(); diff --git a/UnitsNet/GeneratedCode/Quantities/SolidAngle.g.cs b/UnitsNet/GeneratedCode/Quantities/SolidAngle.g.cs index 9889ebdfb0..7e64b9148e 100644 --- a/UnitsNet/GeneratedCode/Quantities/SolidAngle.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SolidAngle.g.cs @@ -397,7 +397,8 @@ public override bool Equals(object obj) /// /// Compare equality to another SolidAngle within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -407,6 +408,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(SolidAngle other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitSteradians(); double otherBaseValue = (double)other.AsBaseUnitSteradians(); diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs index 776cf2577b..aa51e577d2 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs @@ -628,7 +628,8 @@ public override bool Equals(object obj) /// /// Compare equality to another SpecificEnergy within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -638,6 +639,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(SpecificEnergy other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitJoulesPerKilogram(); double otherBaseValue = (double)other.AsBaseUnitJoulesPerKilogram(); diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs index f02fe22b7e..dd038eedac 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs @@ -628,7 +628,8 @@ public override bool Equals(object obj) /// /// Compare equality to another SpecificEntropy within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -638,6 +639,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(SpecificEntropy other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitJoulesPerKilogramKelvin(); double otherBaseValue = (double)other.AsBaseUnitJoulesPerKilogramKelvin(); diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs index b4f37c4c99..9a0d6f62c3 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs @@ -397,7 +397,8 @@ public override bool Equals(object obj) /// /// Compare equality to another SpecificVolume within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -407,6 +408,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(SpecificVolume other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitCubicMetersPerKilogram(); double otherBaseValue = (double)other.AsBaseUnitCubicMetersPerKilogram(); diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs index 05de9b7bab..d2d045573b 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs @@ -925,7 +925,8 @@ public override bool Equals(object obj) /// /// Compare equality to another SpecificWeight within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -935,6 +936,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(SpecificWeight other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitNewtonsPerCubicMeter(); double otherBaseValue = (double)other.AsBaseUnitNewtonsPerCubicMeter(); diff --git a/UnitsNet/GeneratedCode/Quantities/Speed.g.cs b/UnitsNet/GeneratedCode/Quantities/Speed.g.cs index e5061f488a..fb7a1a2e22 100644 --- a/UnitsNet/GeneratedCode/Quantities/Speed.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Speed.g.cs @@ -1420,7 +1420,8 @@ public override bool Equals(object obj) /// /// Compare equality to another Speed within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -1430,6 +1431,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Speed other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitMetersPerSecond(); double otherBaseValue = (double)other.AsBaseUnitMetersPerSecond(); diff --git a/UnitsNet/GeneratedCode/Quantities/Temperature.g.cs b/UnitsNet/GeneratedCode/Quantities/Temperature.g.cs index 7221bc281b..7388958ca1 100644 --- a/UnitsNet/GeneratedCode/Quantities/Temperature.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Temperature.g.cs @@ -586,7 +586,8 @@ public override bool Equals(object obj) /// /// Compare equality to another Temperature within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -596,6 +597,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Temperature other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitKelvins(); double otherBaseValue = (double)other.AsBaseUnitKelvins(); diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.g.cs index 662183c8ac..b75e311e5e 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.g.cs @@ -694,7 +694,8 @@ public override bool Equals(object obj) /// /// Compare equality to another TemperatureChangeRate within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -704,6 +705,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(TemperatureChangeRate other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitDegreesCelsiusPerSecond(); double otherBaseValue = (double)other.AsBaseUnitDegreesCelsiusPerSecond(); diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs index 75a0a6c98b..f705366917 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs @@ -900,7 +900,8 @@ public override bool Equals(object obj) /// /// Compare equality to another TemperatureDelta within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -910,6 +911,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(TemperatureDelta other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitKelvins(); double otherBaseValue = (double)other.AsBaseUnitKelvins(); diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.g.cs index 3a00343d4b..cbc0de53b0 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.g.cs @@ -430,7 +430,8 @@ public override bool Equals(object obj) /// /// Compare equality to another ThermalConductivity within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -440,6 +441,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ThermalConductivity other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitWattsPerMeterKelvin(); double otherBaseValue = (double)other.AsBaseUnitWattsPerMeterKelvin(); diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.g.cs index e6cdf4a48d..a64c574b03 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.g.cs @@ -529,7 +529,8 @@ public override bool Equals(object obj) /// /// Compare equality to another ThermalResistance within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -539,6 +540,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ThermalResistance other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitSquareMeterKelvinsPerKilowatt(); double otherBaseValue = (double)other.AsBaseUnitSquareMeterKelvinsPerKilowatt(); diff --git a/UnitsNet/GeneratedCode/Quantities/Torque.g.cs b/UnitsNet/GeneratedCode/Quantities/Torque.g.cs index 47102079b6..60d22bfb07 100644 --- a/UnitsNet/GeneratedCode/Quantities/Torque.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Torque.g.cs @@ -1057,7 +1057,8 @@ public override bool Equals(object obj) /// /// Compare equality to another Torque within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -1067,6 +1068,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Torque other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitNewtonMeters(); double otherBaseValue = (double)other.AsBaseUnitNewtonMeters(); diff --git a/UnitsNet/GeneratedCode/Quantities/VitaminA.g.cs b/UnitsNet/GeneratedCode/Quantities/VitaminA.g.cs index 9033a04e6a..300ba52371 100644 --- a/UnitsNet/GeneratedCode/Quantities/VitaminA.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VitaminA.g.cs @@ -397,7 +397,8 @@ public override bool Equals(object obj) /// /// Compare equality to another VitaminA within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -407,6 +408,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(VitaminA other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitInternationalUnits(); double otherBaseValue = (double)other.AsBaseUnitInternationalUnits(); diff --git a/UnitsNet/GeneratedCode/Quantities/Volume.g.cs b/UnitsNet/GeneratedCode/Quantities/Volume.g.cs index c787eb08a9..1321fd49c1 100644 --- a/UnitsNet/GeneratedCode/Quantities/Volume.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Volume.g.cs @@ -1818,7 +1818,8 @@ public override bool Equals(object obj) /// /// Compare equality to another Volume within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -1828,6 +1829,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Volume other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitCubicMeters(); double otherBaseValue = (double)other.AsBaseUnitCubicMeters(); diff --git a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs index 3bb931da74..d1ffc20bd1 100644 --- a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs @@ -1156,7 +1156,8 @@ public override bool Equals(object obj) /// /// Compare equality to another VolumeFlow within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -1166,6 +1167,9 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(VolumeFlow other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnitCubicMetersPerSecond(); double otherBaseValue = (double)other.AsBaseUnitCubicMetersPerSecond(); diff --git a/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 b/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 index 50a9427a4f..a9cbe701e4 100644 --- a/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 +++ b/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 @@ -447,7 +447,8 @@ namespace UnitsNet /// /// Compare equality to another $quantityName within the given absolute or relative tolerance. /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance. + /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. + /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. /// @@ -457,6 +458,9 @@ namespace UnitsNet /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals($quantityName other, double tolerance, ComparisonType comparisonType) { + if(tolerance <= 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + double baseValue = (double)AsBaseUnit$baseUnitPluralName(); double otherBaseValue = (double)other.AsBaseUnit$baseUnitPluralName(); From b2898c7c611748905586cc2a4fa349049a6645c1 Mon Sep 17 00:00:00 2001 From: Tristan Milnthorp Date: Thu, 21 Jun 2018 15:35:18 -0400 Subject: [PATCH 08/19] Allow tolerance to be 0 (exact) --- UnitsNet/Comparison.cs | 12 ++++++------ UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs | 4 ++-- .../GeneratedCode/Quantities/AmountOfSubstance.g.cs | 4 ++-- .../GeneratedCode/Quantities/AmplitudeRatio.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Angle.g.cs | 4 ++-- .../GeneratedCode/Quantities/ApparentEnergy.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Area.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs | 4 ++-- .../Quantities/AreaMomentOfInertia.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/BitRate.g.cs | 4 ++-- .../Quantities/BrakeSpecificFuelConsumption.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Capacitance.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Density.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Duration.g.cs | 4 ++-- .../GeneratedCode/Quantities/DynamicViscosity.g.cs | 4 ++-- .../GeneratedCode/Quantities/ElectricAdmittance.g.cs | 4 ++-- .../GeneratedCode/Quantities/ElectricCharge.g.cs | 4 ++-- .../Quantities/ElectricChargeDensity.g.cs | 4 ++-- .../Quantities/ElectricConductance.g.cs | 4 ++-- .../Quantities/ElectricConductivity.g.cs | 4 ++-- .../GeneratedCode/Quantities/ElectricCurrent.g.cs | 4 ++-- .../Quantities/ElectricCurrentDensity.g.cs | 4 ++-- .../Quantities/ElectricCurrentGradient.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs | 4 ++-- .../GeneratedCode/Quantities/ElectricInductance.g.cs | 4 ++-- .../GeneratedCode/Quantities/ElectricPotential.g.cs | 4 ++-- .../Quantities/ElectricPotentialAc.g.cs | 4 ++-- .../Quantities/ElectricPotentialDc.g.cs | 4 ++-- .../GeneratedCode/Quantities/ElectricResistance.g.cs | 4 ++-- .../Quantities/ElectricResistivity.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Energy.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Entropy.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Flow.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Force.g.cs | 4 ++-- .../GeneratedCode/Quantities/ForceChangeRate.g.cs | 4 ++-- .../GeneratedCode/Quantities/ForcePerLength.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Frequency.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs | 4 ++-- .../Quantities/HeatTransferCoefficient.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Information.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs | 4 ++-- .../GeneratedCode/Quantities/KinematicViscosity.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/LapseRate.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Length.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Level.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/LuminousFlux.g.cs | 4 ++-- .../GeneratedCode/Quantities/LuminousIntensity.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/MagneticField.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/MagneticFlux.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Magnetization.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Mass.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs | 4 ++-- .../Quantities/MassMomentOfInertia.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/MolarEnergy.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/MolarEntropy.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Molarity.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Permeability.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Permittivity.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Power.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/PowerRatio.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Pressure.g.cs | 4 ++-- .../GeneratedCode/Quantities/PressureChangeRate.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Ratio.g.cs | 4 ++-- .../GeneratedCode/Quantities/ReactiveEnergy.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/ReactivePower.g.cs | 4 ++-- .../Quantities/RotationalAcceleration.g.cs | 4 ++-- .../GeneratedCode/Quantities/RotationalSpeed.g.cs | 4 ++-- .../Quantities/RotationalStiffness.g.cs | 4 ++-- .../Quantities/RotationalStiffnessPerLength.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/SolidAngle.g.cs | 4 ++-- .../GeneratedCode/Quantities/SpecificEnergy.g.cs | 4 ++-- .../GeneratedCode/Quantities/SpecificEntropy.g.cs | 4 ++-- .../GeneratedCode/Quantities/SpecificVolume.g.cs | 4 ++-- .../GeneratedCode/Quantities/SpecificWeight.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Speed.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Temperature.g.cs | 4 ++-- .../Quantities/TemperatureChangeRate.g.cs | 4 ++-- .../GeneratedCode/Quantities/TemperatureDelta.g.cs | 4 ++-- .../Quantities/ThermalConductivity.g.cs | 4 ++-- .../GeneratedCode/Quantities/ThermalResistance.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Torque.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/VitaminA.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Volume.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs | 4 ++-- .../Scripts/Include-GenerateQuantitySourceCode.ps1 | 4 ++-- 92 files changed, 188 insertions(+), 188 deletions(-) diff --git a/UnitsNet/Comparison.cs b/UnitsNet/Comparison.cs index 8cbf54279d..efd44d70ca 100644 --- a/UnitsNet/Comparison.cs +++ b/UnitsNet/Comparison.cs @@ -37,8 +37,8 @@ public sealed class Comparison /// public static bool Equals(double referenceValue, double value, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); switch(comparisonType) { @@ -61,8 +61,8 @@ public static bool Equals(double referenceValue, double value, double tolerance, /// True if the two values are equal within the given relative tolerance, otherwise false. public static bool EqualsRelative(double referenceValue, double value, double tolerance) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double maxVariation = Math.Abs(referenceValue * tolerance); return Math.Abs(referenceValue - value) <= maxVariation; @@ -78,8 +78,8 @@ public static bool EqualsRelative(double referenceValue, double value, double to /// True if the two values are equal within the given absolute tolerance, otherwise false. public static bool EqualsAbsolute(double value1, double value2, double tolerance) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); return Math.Abs(value1 - value2) <= tolerance; } diff --git a/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs b/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs index a61c84eccb..77dff39bdd 100644 --- a/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs @@ -804,8 +804,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Acceleration other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitMetersPerSecondSquared(); double otherBaseValue = (double)other.AsBaseUnitMetersPerSecondSquared(); diff --git a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs index a7ee0dddd2..131b190875 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs @@ -837,8 +837,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(AmountOfSubstance other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitMoles(); double otherBaseValue = (double)other.AsBaseUnitMoles(); diff --git a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs index 043ac6b24f..c3c1941744 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs @@ -515,8 +515,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(AmplitudeRatio other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitDecibelVolts(); double otherBaseValue = (double)other.AsBaseUnitDecibelVolts(); diff --git a/UnitsNet/GeneratedCode/Quantities/Angle.g.cs b/UnitsNet/GeneratedCode/Quantities/Angle.g.cs index a6a988bc33..47d7f64c33 100644 --- a/UnitsNet/GeneratedCode/Quantities/Angle.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Angle.g.cs @@ -837,8 +837,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Angle other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitDegrees(); double otherBaseValue = (double)other.AsBaseUnitDegrees(); diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs index 6414425bb4..4f9d94d838 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs @@ -474,8 +474,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ApparentEnergy other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitVoltampereHours(); double otherBaseValue = (double)other.AsBaseUnitVoltampereHours(); diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs index 7993d5a6f3..ea6ff16650 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs @@ -507,8 +507,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ApparentPower other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitVoltamperes(); double otherBaseValue = (double)other.AsBaseUnitVoltamperes(); diff --git a/UnitsNet/GeneratedCode/Quantities/Area.g.cs b/UnitsNet/GeneratedCode/Quantities/Area.g.cs index 2294d5e5fa..b4df8d88c9 100644 --- a/UnitsNet/GeneratedCode/Quantities/Area.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Area.g.cs @@ -804,8 +804,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Area other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitSquareMeters(); double otherBaseValue = (double)other.AsBaseUnitSquareMeters(); diff --git a/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs index 9d97a83bda..14f24c7136 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs @@ -408,8 +408,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(AreaDensity other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitKilogramsPerSquareMeter(); double otherBaseValue = (double)other.AsBaseUnitKilogramsPerSquareMeter(); diff --git a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs index b32d8ae6b5..99deba4671 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs @@ -573,8 +573,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(AreaMomentOfInertia other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitMetersToTheFourth(); double otherBaseValue = (double)other.AsBaseUnitMetersToTheFourth(); diff --git a/UnitsNet/GeneratedCode/Quantities/BitRate.g.cs b/UnitsNet/GeneratedCode/Quantities/BitRate.g.cs index d5849f2336..1265e9333e 100644 --- a/UnitsNet/GeneratedCode/Quantities/BitRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BitRate.g.cs @@ -1230,8 +1230,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(BitRate other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitBitsPerSecond(); double otherBaseValue = (double)other.AsBaseUnitBitsPerSecond(); diff --git a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs index 4537ec2560..e1e8ddbae3 100644 --- a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs @@ -474,8 +474,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(BrakeSpecificFuelConsumption other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitKilogramsPerJoule(); double otherBaseValue = (double)other.AsBaseUnitKilogramsPerJoule(); diff --git a/UnitsNet/GeneratedCode/Quantities/Capacitance.g.cs b/UnitsNet/GeneratedCode/Quantities/Capacitance.g.cs index e52e2cdc0a..d4ba81704b 100644 --- a/UnitsNet/GeneratedCode/Quantities/Capacitance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Capacitance.g.cs @@ -408,8 +408,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Capacitance other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitFarads(); double otherBaseValue = (double)other.AsBaseUnitFarads(); diff --git a/UnitsNet/GeneratedCode/Quantities/Density.g.cs b/UnitsNet/GeneratedCode/Quantities/Density.g.cs index accbd6363a..2c65d69845 100644 --- a/UnitsNet/GeneratedCode/Quantities/Density.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Density.g.cs @@ -1629,8 +1629,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Density other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitKilogramsPerCubicMeter(); double otherBaseValue = (double)other.AsBaseUnitKilogramsPerCubicMeter(); diff --git a/UnitsNet/GeneratedCode/Quantities/Duration.g.cs b/UnitsNet/GeneratedCode/Quantities/Duration.g.cs index f0e937d913..bbaad990c0 100644 --- a/UnitsNet/GeneratedCode/Quantities/Duration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Duration.g.cs @@ -773,8 +773,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Duration other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitSeconds(); double otherBaseValue = (double)other.AsBaseUnitSeconds(); diff --git a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs index 6211497e3a..5bd23dcfd1 100644 --- a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs @@ -573,8 +573,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(DynamicViscosity other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitNewtonSecondsPerMeterSquared(); double otherBaseValue = (double)other.AsBaseUnitNewtonSecondsPerMeterSquared(); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs index 304dbfe451..332eb49088 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs @@ -507,8 +507,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ElectricAdmittance other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitSiemens(); double otherBaseValue = (double)other.AsBaseUnitSiemens(); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs index b41d13e4e5..1629f3d427 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs @@ -408,8 +408,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ElectricCharge other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitCoulombs(); double otherBaseValue = (double)other.AsBaseUnitCoulombs(); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs index eb24a37a2a..bf04e197a9 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs @@ -408,8 +408,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ElectricChargeDensity other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitCoulombsPerCubicMeter(); double otherBaseValue = (double)other.AsBaseUnitCoulombsPerCubicMeter(); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs index 227c0bf08f..6129ab8482 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs @@ -474,8 +474,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ElectricConductance other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitSiemens(); double otherBaseValue = (double)other.AsBaseUnitSiemens(); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs index aeb21b4dc3..9444195461 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs @@ -408,8 +408,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ElectricConductivity other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitSiemensPerMeter(); double otherBaseValue = (double)other.AsBaseUnitSiemensPerMeter(); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs index 45125c9d5e..b3550e9d21 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs @@ -606,8 +606,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ElectricCurrent other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitAmperes(); double otherBaseValue = (double)other.AsBaseUnitAmperes(); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs index 13d861b0c5..7ba21c786e 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs @@ -408,8 +408,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ElectricCurrentDensity other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitAmperesPerSquareMeter(); double otherBaseValue = (double)other.AsBaseUnitAmperesPerSquareMeter(); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs index 937bbdb62d..1cb5b625a2 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs @@ -408,8 +408,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ElectricCurrentGradient other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitAmperesPerSecond(); double otherBaseValue = (double)other.AsBaseUnitAmperesPerSecond(); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs index 81d05b1a9d..46c2e280f7 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs @@ -408,8 +408,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ElectricField other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitVoltsPerMeter(); double otherBaseValue = (double)other.AsBaseUnitVoltsPerMeter(); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs index 9b70f6cc94..cba91d5aa6 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs @@ -408,8 +408,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ElectricInductance other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitHenries(); double otherBaseValue = (double)other.AsBaseUnitHenries(); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs index 37a0957965..c62c247a54 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs @@ -540,8 +540,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ElectricPotential other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitVolts(); double otherBaseValue = (double)other.AsBaseUnitVolts(); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.g.cs index 65e331a033..b98119a07f 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.g.cs @@ -540,8 +540,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ElectricPotentialAc other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitVoltsAc(); double otherBaseValue = (double)other.AsBaseUnitVoltsAc(); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.g.cs index 48fa109d6e..c8262c4863 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.g.cs @@ -540,8 +540,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ElectricPotentialDc other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitVoltsDc(); double otherBaseValue = (double)other.AsBaseUnitVoltsDc(); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs index 9512388a10..eb78a2e979 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs @@ -507,8 +507,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ElectricResistance other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitOhms(); double otherBaseValue = (double)other.AsBaseUnitOhms(); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs index 91a2418fa5..ada3a3ebf3 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs @@ -507,8 +507,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ElectricResistivity other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitOhmMeters(); double otherBaseValue = (double)other.AsBaseUnitOhmMeters(); diff --git a/UnitsNet/GeneratedCode/Quantities/Energy.g.cs b/UnitsNet/GeneratedCode/Quantities/Energy.g.cs index 3988c62599..ec05aa21be 100644 --- a/UnitsNet/GeneratedCode/Quantities/Energy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Energy.g.cs @@ -1101,8 +1101,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Energy other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitJoules(); double otherBaseValue = (double)other.AsBaseUnitJoules(); diff --git a/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs b/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs index 7f656371bd..335e9154fb 100644 --- a/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs @@ -606,8 +606,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Entropy other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitJoulesPerKelvin(); double otherBaseValue = (double)other.AsBaseUnitJoulesPerKelvin(); diff --git a/UnitsNet/GeneratedCode/Quantities/Flow.g.cs b/UnitsNet/GeneratedCode/Quantities/Flow.g.cs index e7333961bc..c4ea68f26d 100644 --- a/UnitsNet/GeneratedCode/Quantities/Flow.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Flow.g.cs @@ -1185,8 +1185,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Flow other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitCubicMetersPerSecond(); double otherBaseValue = (double)other.AsBaseUnitCubicMetersPerSecond(); diff --git a/UnitsNet/GeneratedCode/Quantities/Force.g.cs b/UnitsNet/GeneratedCode/Quantities/Force.g.cs index 0eb4c9ba34..402d072938 100644 --- a/UnitsNet/GeneratedCode/Quantities/Force.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Force.g.cs @@ -705,8 +705,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Force other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitNewtons(); double otherBaseValue = (double)other.AsBaseUnitNewtons(); diff --git a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs index a1c7c0f5b1..f148da2f1b 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs @@ -738,8 +738,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ForceChangeRate other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitNewtonsPerSecond(); double otherBaseValue = (double)other.AsBaseUnitNewtonsPerSecond(); diff --git a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs index 8640c1e709..e9c2090e19 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs @@ -672,8 +672,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ForcePerLength other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitNewtonsPerMeter(); double otherBaseValue = (double)other.AsBaseUnitNewtonsPerMeter(); diff --git a/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs b/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs index 34f6619170..a29b46df03 100644 --- a/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs @@ -639,8 +639,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Frequency other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitHertz(); double otherBaseValue = (double)other.AsBaseUnitHertz(); diff --git a/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs index 14731bcab4..f78231c3a2 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs @@ -903,8 +903,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(HeatFlux other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitWattsPerSquareMeter(); double otherBaseValue = (double)other.AsBaseUnitWattsPerSquareMeter(); diff --git a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs index e57d1c92b0..c5dfb7e143 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs @@ -441,8 +441,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(HeatTransferCoefficient other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitWattsPerSquareMeterKelvin(); double otherBaseValue = (double)other.AsBaseUnitWattsPerSquareMeterKelvin(); diff --git a/UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs b/UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs index 80c5080919..57d5df99a4 100644 --- a/UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs @@ -507,8 +507,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Illuminance other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitLux(); double otherBaseValue = (double)other.AsBaseUnitLux(); diff --git a/UnitsNet/GeneratedCode/Quantities/Information.g.cs b/UnitsNet/GeneratedCode/Quantities/Information.g.cs index 7033b45010..b5a8620351 100644 --- a/UnitsNet/GeneratedCode/Quantities/Information.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Information.g.cs @@ -1230,8 +1230,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Information other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitBits(); double otherBaseValue = (double)other.AsBaseUnitBits(); diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs index 82796f8b70..811c795785 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs @@ -441,8 +441,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Irradiance other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitWattsPerSquareMeter(); double otherBaseValue = (double)other.AsBaseUnitWattsPerSquareMeter(); diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs index bde17ba01c..782bd2ea02 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs @@ -474,8 +474,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Irradiation other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitJoulesPerSquareMeter(); double otherBaseValue = (double)other.AsBaseUnitJoulesPerSquareMeter(); diff --git a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs index 23421c1ff8..d3dec5895f 100644 --- a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs @@ -639,8 +639,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(KinematicViscosity other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitSquareMetersPerSecond(); double otherBaseValue = (double)other.AsBaseUnitSquareMetersPerSecond(); diff --git a/UnitsNet/GeneratedCode/Quantities/LapseRate.g.cs b/UnitsNet/GeneratedCode/Quantities/LapseRate.g.cs index 789518053b..6f7a34b2e9 100644 --- a/UnitsNet/GeneratedCode/Quantities/LapseRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LapseRate.g.cs @@ -408,8 +408,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(LapseRate other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitDegreesCelciusPerKilometer(); double otherBaseValue = (double)other.AsBaseUnitDegreesCelciusPerKilometer(); diff --git a/UnitsNet/GeneratedCode/Quantities/Length.g.cs b/UnitsNet/GeneratedCode/Quantities/Length.g.cs index c25fe1787c..404ffa30f2 100644 --- a/UnitsNet/GeneratedCode/Quantities/Length.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Length.g.cs @@ -1101,8 +1101,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Length other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitMeters(); double otherBaseValue = (double)other.AsBaseUnitMeters(); diff --git a/UnitsNet/GeneratedCode/Quantities/Level.g.cs b/UnitsNet/GeneratedCode/Quantities/Level.g.cs index d47d45fa7b..445735caf4 100644 --- a/UnitsNet/GeneratedCode/Quantities/Level.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Level.g.cs @@ -449,8 +449,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Level other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitDecibels(); double otherBaseValue = (double)other.AsBaseUnitDecibels(); diff --git a/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs index 1bcfaab9d9..e207683a38 100644 --- a/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs @@ -474,8 +474,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(LinearDensity other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitKilogramsPerMeter(); double otherBaseValue = (double)other.AsBaseUnitKilogramsPerMeter(); diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.g.cs index 86b49c5120..7d7c0c2a2b 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.g.cs @@ -408,8 +408,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(LuminousFlux other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitLumens(); double otherBaseValue = (double)other.AsBaseUnitLumens(); diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs index 3134004973..7dc76085b5 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs @@ -408,8 +408,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(LuminousIntensity other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitCandela(); double otherBaseValue = (double)other.AsBaseUnitCandela(); diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticField.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticField.g.cs index 979ba90730..53ddb0b4e8 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticField.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticField.g.cs @@ -408,8 +408,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(MagneticField other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitTeslas(); double otherBaseValue = (double)other.AsBaseUnitTeslas(); diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.g.cs index fa0d7133b2..8929469a8c 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.g.cs @@ -408,8 +408,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(MagneticFlux other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitWebers(); double otherBaseValue = (double)other.AsBaseUnitWebers(); diff --git a/UnitsNet/GeneratedCode/Quantities/Magnetization.g.cs b/UnitsNet/GeneratedCode/Quantities/Magnetization.g.cs index 85b37b1877..65ee7026f6 100644 --- a/UnitsNet/GeneratedCode/Quantities/Magnetization.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Magnetization.g.cs @@ -408,8 +408,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Magnetization other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitAmperesPerMeter(); double otherBaseValue = (double)other.AsBaseUnitAmperesPerMeter(); diff --git a/UnitsNet/GeneratedCode/Quantities/Mass.g.cs b/UnitsNet/GeneratedCode/Quantities/Mass.g.cs index 8c60b07d1c..ebfda21878 100644 --- a/UnitsNet/GeneratedCode/Quantities/Mass.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Mass.g.cs @@ -1068,8 +1068,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Mass other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitKilograms(); double otherBaseValue = (double)other.AsBaseUnitKilograms(); diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs index 393d967008..54126f7346 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs @@ -870,8 +870,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(MassFlow other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitGramsPerSecond(); double otherBaseValue = (double)other.AsBaseUnitGramsPerSecond(); diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs index d36e9d0a5c..d46ebf5538 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs @@ -441,8 +441,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(MassFlux other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitKilogramsPerSecondPerSquareMeter(); double otherBaseValue = (double)other.AsBaseUnitKilogramsPerSecondPerSquareMeter(); diff --git a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.g.cs b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.g.cs index 82f6d38d34..317f0e0851 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.g.cs @@ -1233,8 +1233,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(MassMomentOfInertia other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitKilogramSquareMeters(); double otherBaseValue = (double)other.AsBaseUnitKilogramSquareMeters(); diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.g.cs index 01e1fd340b..590dee926f 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.g.cs @@ -474,8 +474,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(MolarEnergy other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitJoulesPerMole(); double otherBaseValue = (double)other.AsBaseUnitJoulesPerMole(); diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.g.cs index c7fb5e73f9..da71c8c561 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.g.cs @@ -474,8 +474,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(MolarEntropy other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitJoulesPerMoleKelvin(); double otherBaseValue = (double)other.AsBaseUnitJoulesPerMoleKelvin(); diff --git a/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs index 3d4675e4c2..da231984dd 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs @@ -771,8 +771,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(MolarMass other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitKilogramsPerMole(); double otherBaseValue = (double)other.AsBaseUnitKilogramsPerMole(); diff --git a/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs b/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs index 43e923f34d..6393482bc5 100644 --- a/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs @@ -639,8 +639,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Molarity other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitMolesPerCubicMeter(); double otherBaseValue = (double)other.AsBaseUnitMolesPerCubicMeter(); diff --git a/UnitsNet/GeneratedCode/Quantities/Permeability.g.cs b/UnitsNet/GeneratedCode/Quantities/Permeability.g.cs index 1a3b3fd28d..fafe236a55 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permeability.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permeability.g.cs @@ -408,8 +408,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Permeability other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitHenriesPerMeter(); double otherBaseValue = (double)other.AsBaseUnitHenriesPerMeter(); diff --git a/UnitsNet/GeneratedCode/Quantities/Permittivity.g.cs b/UnitsNet/GeneratedCode/Quantities/Permittivity.g.cs index d670f53530..6ba4044bc2 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permittivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permittivity.g.cs @@ -408,8 +408,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Permittivity other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitFaradsPerMeter(); double otherBaseValue = (double)other.AsBaseUnitFaradsPerMeter(); diff --git a/UnitsNet/GeneratedCode/Quantities/Power.g.cs b/UnitsNet/GeneratedCode/Quantities/Power.g.cs index aeb235deb3..9b3e6a9636 100644 --- a/UnitsNet/GeneratedCode/Quantities/Power.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Power.g.cs @@ -1032,8 +1032,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Power other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitWatts(); double otherBaseValue = (double)other.AsBaseUnitWatts(); diff --git a/UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs index c7b8aefd1d..cb9ed62598 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs @@ -1827,8 +1827,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(PowerDensity other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitWattsPerCubicMeter(); double otherBaseValue = (double)other.AsBaseUnitWattsPerCubicMeter(); diff --git a/UnitsNet/GeneratedCode/Quantities/PowerRatio.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerRatio.g.cs index d07877ba3d..9009f33418 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerRatio.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerRatio.g.cs @@ -449,8 +449,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(PowerRatio other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitDecibelWatts(); double otherBaseValue = (double)other.AsBaseUnitDecibelWatts(); diff --git a/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs b/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs index 7f22e09aec..e42608986c 100644 --- a/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs @@ -1630,8 +1630,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Pressure other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitPascals(); double otherBaseValue = (double)other.AsBaseUnitPascals(); diff --git a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs index 71238a9005..a6caf7c390 100644 --- a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs @@ -507,8 +507,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(PressureChangeRate other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitPascalsPerSecond(); double otherBaseValue = (double)other.AsBaseUnitPascalsPerSecond(); diff --git a/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs b/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs index 4bf8aae11e..de44e711eb 100644 --- a/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs @@ -573,8 +573,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Ratio other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitDecimalFractions(); double otherBaseValue = (double)other.AsBaseUnitDecimalFractions(); diff --git a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.g.cs index e9acd46514..edf8bf9f3d 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.g.cs @@ -474,8 +474,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ReactiveEnergy other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitVoltampereReactiveHours(); double otherBaseValue = (double)other.AsBaseUnitVoltampereReactiveHours(); diff --git a/UnitsNet/GeneratedCode/Quantities/ReactivePower.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactivePower.g.cs index 3f6ed5d974..eb24ac548f 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactivePower.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactivePower.g.cs @@ -507,8 +507,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ReactivePower other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitVoltamperesReactive(); double otherBaseValue = (double)other.AsBaseUnitVoltamperesReactive(); diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.g.cs index 64343affc1..51600eecb8 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.g.cs @@ -474,8 +474,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(RotationalAcceleration other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitRadiansPerSecondSquared(); double otherBaseValue = (double)other.AsBaseUnitRadiansPerSecondSquared(); diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs index 79834a04e4..6cbead3702 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs @@ -804,8 +804,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(RotationalSpeed other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitRadiansPerSecond(); double otherBaseValue = (double)other.AsBaseUnitRadiansPerSecond(); diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs index 54b1b6f98a..4696a2c5a2 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs @@ -474,8 +474,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(RotationalStiffness other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitNewtonMetersPerRadian(); double otherBaseValue = (double)other.AsBaseUnitNewtonMetersPerRadian(); diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs index a6a6399c03..8e63434dc6 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs @@ -474,8 +474,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(RotationalStiffnessPerLength other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitNewtonMetersPerRadianPerMeter(); double otherBaseValue = (double)other.AsBaseUnitNewtonMetersPerRadianPerMeter(); diff --git a/UnitsNet/GeneratedCode/Quantities/SolidAngle.g.cs b/UnitsNet/GeneratedCode/Quantities/SolidAngle.g.cs index 7e64b9148e..94727b1536 100644 --- a/UnitsNet/GeneratedCode/Quantities/SolidAngle.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SolidAngle.g.cs @@ -408,8 +408,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(SolidAngle other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitSteradians(); double otherBaseValue = (double)other.AsBaseUnitSteradians(); diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs index aa51e577d2..bc778fd65f 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs @@ -639,8 +639,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(SpecificEnergy other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitJoulesPerKilogram(); double otherBaseValue = (double)other.AsBaseUnitJoulesPerKilogram(); diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs index dd038eedac..860c96cf93 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs @@ -639,8 +639,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(SpecificEntropy other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitJoulesPerKilogramKelvin(); double otherBaseValue = (double)other.AsBaseUnitJoulesPerKilogramKelvin(); diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs index 9a0d6f62c3..80690bb580 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs @@ -408,8 +408,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(SpecificVolume other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitCubicMetersPerKilogram(); double otherBaseValue = (double)other.AsBaseUnitCubicMetersPerKilogram(); diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs index d2d045573b..0d19dc78f3 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs @@ -936,8 +936,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(SpecificWeight other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitNewtonsPerCubicMeter(); double otherBaseValue = (double)other.AsBaseUnitNewtonsPerCubicMeter(); diff --git a/UnitsNet/GeneratedCode/Quantities/Speed.g.cs b/UnitsNet/GeneratedCode/Quantities/Speed.g.cs index fb7a1a2e22..102d50497c 100644 --- a/UnitsNet/GeneratedCode/Quantities/Speed.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Speed.g.cs @@ -1431,8 +1431,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Speed other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitMetersPerSecond(); double otherBaseValue = (double)other.AsBaseUnitMetersPerSecond(); diff --git a/UnitsNet/GeneratedCode/Quantities/Temperature.g.cs b/UnitsNet/GeneratedCode/Quantities/Temperature.g.cs index 7388958ca1..a44d84a4c3 100644 --- a/UnitsNet/GeneratedCode/Quantities/Temperature.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Temperature.g.cs @@ -597,8 +597,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Temperature other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitKelvins(); double otherBaseValue = (double)other.AsBaseUnitKelvins(); diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.g.cs index b75e311e5e..fcec152445 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.g.cs @@ -705,8 +705,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(TemperatureChangeRate other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitDegreesCelsiusPerSecond(); double otherBaseValue = (double)other.AsBaseUnitDegreesCelsiusPerSecond(); diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs index f705366917..e2cde94add 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs @@ -911,8 +911,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(TemperatureDelta other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitKelvins(); double otherBaseValue = (double)other.AsBaseUnitKelvins(); diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.g.cs index cbc0de53b0..ea700c3d0e 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.g.cs @@ -441,8 +441,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ThermalConductivity other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitWattsPerMeterKelvin(); double otherBaseValue = (double)other.AsBaseUnitWattsPerMeterKelvin(); diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.g.cs index a64c574b03..07ed56d91b 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.g.cs @@ -540,8 +540,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ThermalResistance other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitSquareMeterKelvinsPerKilowatt(); double otherBaseValue = (double)other.AsBaseUnitSquareMeterKelvinsPerKilowatt(); diff --git a/UnitsNet/GeneratedCode/Quantities/Torque.g.cs b/UnitsNet/GeneratedCode/Quantities/Torque.g.cs index 60d22bfb07..3a59394f68 100644 --- a/UnitsNet/GeneratedCode/Quantities/Torque.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Torque.g.cs @@ -1068,8 +1068,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Torque other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitNewtonMeters(); double otherBaseValue = (double)other.AsBaseUnitNewtonMeters(); diff --git a/UnitsNet/GeneratedCode/Quantities/VitaminA.g.cs b/UnitsNet/GeneratedCode/Quantities/VitaminA.g.cs index 300ba52371..440f86dc3b 100644 --- a/UnitsNet/GeneratedCode/Quantities/VitaminA.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VitaminA.g.cs @@ -408,8 +408,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(VitaminA other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitInternationalUnits(); double otherBaseValue = (double)other.AsBaseUnitInternationalUnits(); diff --git a/UnitsNet/GeneratedCode/Quantities/Volume.g.cs b/UnitsNet/GeneratedCode/Quantities/Volume.g.cs index 1321fd49c1..726c5f9961 100644 --- a/UnitsNet/GeneratedCode/Quantities/Volume.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Volume.g.cs @@ -1829,8 +1829,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Volume other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitCubicMeters(); double otherBaseValue = (double)other.AsBaseUnitCubicMeters(); diff --git a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs index d1ffc20bd1..da076bdbbe 100644 --- a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs @@ -1167,8 +1167,8 @@ public override bool Equals(object obj) /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(VolumeFlow other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnitCubicMetersPerSecond(); double otherBaseValue = (double)other.AsBaseUnitCubicMetersPerSecond(); diff --git a/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 b/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 index a9cbe701e4..6745fa0528 100644 --- a/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 +++ b/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 @@ -458,8 +458,8 @@ namespace UnitsNet /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals($quantityName other, double tolerance, ComparisonType comparisonType) { - if(tolerance <= 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than 0"); + if(tolerance < 0) + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double baseValue = (double)AsBaseUnit$baseUnitPluralName(); double otherBaseValue = (double)other.AsBaseUnit$baseUnitPluralName(); From 882a4d7279c34a655dd095e8e3a3db3e2f1a4e09 Mon Sep 17 00:00:00 2001 From: Tristan Milnthorp Date: Thu, 21 Jun 2018 15:45:54 -0400 Subject: [PATCH 09/19] Make sure comparison is done to the current units of [this] so scaling isn't done when not using base units. [this] will be the reference for relative units. --- UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/Angle.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/Area.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/BitRate.g.cs | 6 +++--- .../Quantities/BrakeSpecificFuelConsumption.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/Capacitance.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/Density.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/Duration.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs | 6 +++--- .../GeneratedCode/Quantities/ElectricChargeDensity.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs | 6 +++--- .../GeneratedCode/Quantities/ElectricCurrentDensity.g.cs | 6 +++--- .../GeneratedCode/Quantities/ElectricCurrentGradient.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/Energy.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/Entropy.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/Flow.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/Force.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/Frequency.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs | 6 +++--- .../GeneratedCode/Quantities/HeatTransferCoefficient.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/Information.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/LapseRate.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/Length.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/Level.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/LuminousFlux.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/MagneticField.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/MagneticFlux.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/Magnetization.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/Mass.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/MolarEnergy.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/MolarEntropy.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/Molarity.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/Permeability.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/Permittivity.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/Power.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/PowerRatio.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/Pressure.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/Ratio.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/ReactivePower.g.cs | 6 +++--- .../GeneratedCode/Quantities/RotationalAcceleration.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs | 6 +++--- .../Quantities/RotationalStiffnessPerLength.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/SolidAngle.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/Speed.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/Temperature.g.cs | 6 +++--- .../GeneratedCode/Quantities/TemperatureChangeRate.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/ThermalConductivity.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/ThermalResistance.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/Torque.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/VitaminA.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/Volume.g.cs | 6 +++--- UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs | 6 +++--- UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 | 6 +++--- 91 files changed, 273 insertions(+), 273 deletions(-) diff --git a/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs b/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs index 77dff39bdd..b92b2d6a93 100644 --- a/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs @@ -807,10 +807,10 @@ public bool Equals(Acceleration other, double tolerance, ComparisonType comparis if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitMetersPerSecondSquared(); - double otherBaseValue = (double)other.AsBaseUnitMetersPerSecondSquared(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs index 131b190875..7bc590b96f 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs @@ -840,10 +840,10 @@ public bool Equals(AmountOfSubstance other, double tolerance, ComparisonType com if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitMoles(); - double otherBaseValue = (double)other.AsBaseUnitMoles(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs index c3c1941744..f1b1a0733b 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs @@ -518,10 +518,10 @@ public bool Equals(AmplitudeRatio other, double tolerance, ComparisonType compar if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitDecibelVolts(); - double otherBaseValue = (double)other.AsBaseUnitDecibelVolts(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Angle.g.cs b/UnitsNet/GeneratedCode/Quantities/Angle.g.cs index 47d7f64c33..074818f683 100644 --- a/UnitsNet/GeneratedCode/Quantities/Angle.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Angle.g.cs @@ -840,10 +840,10 @@ public bool Equals(Angle other, double tolerance, ComparisonType comparisonType) if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitDegrees(); - double otherBaseValue = (double)other.AsBaseUnitDegrees(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs index 4f9d94d838..d2c0dc1d31 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs @@ -477,10 +477,10 @@ public bool Equals(ApparentEnergy other, double tolerance, ComparisonType compar if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitVoltampereHours(); - double otherBaseValue = (double)other.AsBaseUnitVoltampereHours(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs index ea6ff16650..aefbfbaabe 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs @@ -510,10 +510,10 @@ public bool Equals(ApparentPower other, double tolerance, ComparisonType compari if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitVoltamperes(); - double otherBaseValue = (double)other.AsBaseUnitVoltamperes(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Area.g.cs b/UnitsNet/GeneratedCode/Quantities/Area.g.cs index b4df8d88c9..1de05f06a6 100644 --- a/UnitsNet/GeneratedCode/Quantities/Area.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Area.g.cs @@ -807,10 +807,10 @@ public bool Equals(Area other, double tolerance, ComparisonType comparisonType) if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitSquareMeters(); - double otherBaseValue = (double)other.AsBaseUnitSquareMeters(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs index 14f24c7136..892f70c197 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs @@ -411,10 +411,10 @@ public bool Equals(AreaDensity other, double tolerance, ComparisonType compariso if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitKilogramsPerSquareMeter(); - double otherBaseValue = (double)other.AsBaseUnitKilogramsPerSquareMeter(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs index 99deba4671..084acecf97 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs @@ -576,10 +576,10 @@ public bool Equals(AreaMomentOfInertia other, double tolerance, ComparisonType c if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitMetersToTheFourth(); - double otherBaseValue = (double)other.AsBaseUnitMetersToTheFourth(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/BitRate.g.cs b/UnitsNet/GeneratedCode/Quantities/BitRate.g.cs index 1265e9333e..b27b26e9e5 100644 --- a/UnitsNet/GeneratedCode/Quantities/BitRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BitRate.g.cs @@ -1233,10 +1233,10 @@ public bool Equals(BitRate other, double tolerance, ComparisonType comparisonTyp if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitBitsPerSecond(); - double otherBaseValue = (double)other.AsBaseUnitBitsPerSecond(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs index e1e8ddbae3..3b7b690b19 100644 --- a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs @@ -477,10 +477,10 @@ public bool Equals(BrakeSpecificFuelConsumption other, double tolerance, Compari if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitKilogramsPerJoule(); - double otherBaseValue = (double)other.AsBaseUnitKilogramsPerJoule(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Capacitance.g.cs b/UnitsNet/GeneratedCode/Quantities/Capacitance.g.cs index d4ba81704b..4b676be90a 100644 --- a/UnitsNet/GeneratedCode/Quantities/Capacitance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Capacitance.g.cs @@ -411,10 +411,10 @@ public bool Equals(Capacitance other, double tolerance, ComparisonType compariso if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitFarads(); - double otherBaseValue = (double)other.AsBaseUnitFarads(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Density.g.cs b/UnitsNet/GeneratedCode/Quantities/Density.g.cs index 2c65d69845..0a2d6e6b90 100644 --- a/UnitsNet/GeneratedCode/Quantities/Density.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Density.g.cs @@ -1632,10 +1632,10 @@ public bool Equals(Density other, double tolerance, ComparisonType comparisonTyp if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitKilogramsPerCubicMeter(); - double otherBaseValue = (double)other.AsBaseUnitKilogramsPerCubicMeter(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Duration.g.cs b/UnitsNet/GeneratedCode/Quantities/Duration.g.cs index bbaad990c0..388631b5a6 100644 --- a/UnitsNet/GeneratedCode/Quantities/Duration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Duration.g.cs @@ -776,10 +776,10 @@ public bool Equals(Duration other, double tolerance, ComparisonType comparisonTy if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitSeconds(); - double otherBaseValue = (double)other.AsBaseUnitSeconds(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs index 5bd23dcfd1..9a29ab7090 100644 --- a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs @@ -576,10 +576,10 @@ public bool Equals(DynamicViscosity other, double tolerance, ComparisonType comp if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitNewtonSecondsPerMeterSquared(); - double otherBaseValue = (double)other.AsBaseUnitNewtonSecondsPerMeterSquared(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs index 332eb49088..42b5cd8167 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs @@ -510,10 +510,10 @@ public bool Equals(ElectricAdmittance other, double tolerance, ComparisonType co if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitSiemens(); - double otherBaseValue = (double)other.AsBaseUnitSiemens(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs index 1629f3d427..3a6589f332 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs @@ -411,10 +411,10 @@ public bool Equals(ElectricCharge other, double tolerance, ComparisonType compar if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitCoulombs(); - double otherBaseValue = (double)other.AsBaseUnitCoulombs(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs index bf04e197a9..414e0265bf 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs @@ -411,10 +411,10 @@ public bool Equals(ElectricChargeDensity other, double tolerance, ComparisonType if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitCoulombsPerCubicMeter(); - double otherBaseValue = (double)other.AsBaseUnitCoulombsPerCubicMeter(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs index 6129ab8482..255e95256e 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs @@ -477,10 +477,10 @@ public bool Equals(ElectricConductance other, double tolerance, ComparisonType c if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitSiemens(); - double otherBaseValue = (double)other.AsBaseUnitSiemens(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs index 9444195461..e987a4d16e 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs @@ -411,10 +411,10 @@ public bool Equals(ElectricConductivity other, double tolerance, ComparisonType if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitSiemensPerMeter(); - double otherBaseValue = (double)other.AsBaseUnitSiemensPerMeter(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs index b3550e9d21..1e09fd6c53 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs @@ -609,10 +609,10 @@ public bool Equals(ElectricCurrent other, double tolerance, ComparisonType compa if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitAmperes(); - double otherBaseValue = (double)other.AsBaseUnitAmperes(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs index 7ba21c786e..097cdf484a 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs @@ -411,10 +411,10 @@ public bool Equals(ElectricCurrentDensity other, double tolerance, ComparisonTyp if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitAmperesPerSquareMeter(); - double otherBaseValue = (double)other.AsBaseUnitAmperesPerSquareMeter(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs index 1cb5b625a2..240b078ff2 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs @@ -411,10 +411,10 @@ public bool Equals(ElectricCurrentGradient other, double tolerance, ComparisonTy if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitAmperesPerSecond(); - double otherBaseValue = (double)other.AsBaseUnitAmperesPerSecond(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs index 46c2e280f7..baa14a850e 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs @@ -411,10 +411,10 @@ public bool Equals(ElectricField other, double tolerance, ComparisonType compari if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitVoltsPerMeter(); - double otherBaseValue = (double)other.AsBaseUnitVoltsPerMeter(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs index cba91d5aa6..1254073505 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs @@ -411,10 +411,10 @@ public bool Equals(ElectricInductance other, double tolerance, ComparisonType co if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitHenries(); - double otherBaseValue = (double)other.AsBaseUnitHenries(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs index c62c247a54..13ad755da6 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs @@ -543,10 +543,10 @@ public bool Equals(ElectricPotential other, double tolerance, ComparisonType com if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitVolts(); - double otherBaseValue = (double)other.AsBaseUnitVolts(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.g.cs index b98119a07f..1809af7b54 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.g.cs @@ -543,10 +543,10 @@ public bool Equals(ElectricPotentialAc other, double tolerance, ComparisonType c if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitVoltsAc(); - double otherBaseValue = (double)other.AsBaseUnitVoltsAc(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.g.cs index c8262c4863..9d4ed76045 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.g.cs @@ -543,10 +543,10 @@ public bool Equals(ElectricPotentialDc other, double tolerance, ComparisonType c if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitVoltsDc(); - double otherBaseValue = (double)other.AsBaseUnitVoltsDc(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs index eb78a2e979..8f869309d7 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs @@ -510,10 +510,10 @@ public bool Equals(ElectricResistance other, double tolerance, ComparisonType co if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitOhms(); - double otherBaseValue = (double)other.AsBaseUnitOhms(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs index ada3a3ebf3..7971153533 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs @@ -510,10 +510,10 @@ public bool Equals(ElectricResistivity other, double tolerance, ComparisonType c if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitOhmMeters(); - double otherBaseValue = (double)other.AsBaseUnitOhmMeters(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Energy.g.cs b/UnitsNet/GeneratedCode/Quantities/Energy.g.cs index ec05aa21be..8164feedc3 100644 --- a/UnitsNet/GeneratedCode/Quantities/Energy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Energy.g.cs @@ -1104,10 +1104,10 @@ public bool Equals(Energy other, double tolerance, ComparisonType comparisonType if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitJoules(); - double otherBaseValue = (double)other.AsBaseUnitJoules(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs b/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs index 335e9154fb..ad899e9a78 100644 --- a/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs @@ -609,10 +609,10 @@ public bool Equals(Entropy other, double tolerance, ComparisonType comparisonTyp if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitJoulesPerKelvin(); - double otherBaseValue = (double)other.AsBaseUnitJoulesPerKelvin(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Flow.g.cs b/UnitsNet/GeneratedCode/Quantities/Flow.g.cs index c4ea68f26d..d7dd97fd46 100644 --- a/UnitsNet/GeneratedCode/Quantities/Flow.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Flow.g.cs @@ -1188,10 +1188,10 @@ public bool Equals(Flow other, double tolerance, ComparisonType comparisonType) if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitCubicMetersPerSecond(); - double otherBaseValue = (double)other.AsBaseUnitCubicMetersPerSecond(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Force.g.cs b/UnitsNet/GeneratedCode/Quantities/Force.g.cs index 402d072938..249071289b 100644 --- a/UnitsNet/GeneratedCode/Quantities/Force.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Force.g.cs @@ -708,10 +708,10 @@ public bool Equals(Force other, double tolerance, ComparisonType comparisonType) if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitNewtons(); - double otherBaseValue = (double)other.AsBaseUnitNewtons(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs index f148da2f1b..5366f9189e 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs @@ -741,10 +741,10 @@ public bool Equals(ForceChangeRate other, double tolerance, ComparisonType compa if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitNewtonsPerSecond(); - double otherBaseValue = (double)other.AsBaseUnitNewtonsPerSecond(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs index e9c2090e19..f5c931dec3 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs @@ -675,10 +675,10 @@ public bool Equals(ForcePerLength other, double tolerance, ComparisonType compar if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitNewtonsPerMeter(); - double otherBaseValue = (double)other.AsBaseUnitNewtonsPerMeter(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs b/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs index a29b46df03..c7e772410e 100644 --- a/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs @@ -642,10 +642,10 @@ public bool Equals(Frequency other, double tolerance, ComparisonType comparisonT if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitHertz(); - double otherBaseValue = (double)other.AsBaseUnitHertz(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs index f78231c3a2..830293fe24 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs @@ -906,10 +906,10 @@ public bool Equals(HeatFlux other, double tolerance, ComparisonType comparisonTy if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitWattsPerSquareMeter(); - double otherBaseValue = (double)other.AsBaseUnitWattsPerSquareMeter(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs index c5dfb7e143..5f466d2fcf 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs @@ -444,10 +444,10 @@ public bool Equals(HeatTransferCoefficient other, double tolerance, ComparisonTy if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitWattsPerSquareMeterKelvin(); - double otherBaseValue = (double)other.AsBaseUnitWattsPerSquareMeterKelvin(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs b/UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs index 57d5df99a4..7767a1f893 100644 --- a/UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs @@ -510,10 +510,10 @@ public bool Equals(Illuminance other, double tolerance, ComparisonType compariso if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitLux(); - double otherBaseValue = (double)other.AsBaseUnitLux(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Information.g.cs b/UnitsNet/GeneratedCode/Quantities/Information.g.cs index b5a8620351..d987c96185 100644 --- a/UnitsNet/GeneratedCode/Quantities/Information.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Information.g.cs @@ -1233,10 +1233,10 @@ public bool Equals(Information other, double tolerance, ComparisonType compariso if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitBits(); - double otherBaseValue = (double)other.AsBaseUnitBits(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs index 811c795785..9ada92f1bc 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs @@ -444,10 +444,10 @@ public bool Equals(Irradiance other, double tolerance, ComparisonType comparison if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitWattsPerSquareMeter(); - double otherBaseValue = (double)other.AsBaseUnitWattsPerSquareMeter(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs index 782bd2ea02..deb55e179b 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs @@ -477,10 +477,10 @@ public bool Equals(Irradiation other, double tolerance, ComparisonType compariso if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitJoulesPerSquareMeter(); - double otherBaseValue = (double)other.AsBaseUnitJoulesPerSquareMeter(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs index d3dec5895f..442f8f2930 100644 --- a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs @@ -642,10 +642,10 @@ public bool Equals(KinematicViscosity other, double tolerance, ComparisonType co if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitSquareMetersPerSecond(); - double otherBaseValue = (double)other.AsBaseUnitSquareMetersPerSecond(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/LapseRate.g.cs b/UnitsNet/GeneratedCode/Quantities/LapseRate.g.cs index 6f7a34b2e9..32779ac005 100644 --- a/UnitsNet/GeneratedCode/Quantities/LapseRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LapseRate.g.cs @@ -411,10 +411,10 @@ public bool Equals(LapseRate other, double tolerance, ComparisonType comparisonT if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitDegreesCelciusPerKilometer(); - double otherBaseValue = (double)other.AsBaseUnitDegreesCelciusPerKilometer(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Length.g.cs b/UnitsNet/GeneratedCode/Quantities/Length.g.cs index 404ffa30f2..54552bfcd9 100644 --- a/UnitsNet/GeneratedCode/Quantities/Length.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Length.g.cs @@ -1104,10 +1104,10 @@ public bool Equals(Length other, double tolerance, ComparisonType comparisonType if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitMeters(); - double otherBaseValue = (double)other.AsBaseUnitMeters(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Level.g.cs b/UnitsNet/GeneratedCode/Quantities/Level.g.cs index 445735caf4..97ac894028 100644 --- a/UnitsNet/GeneratedCode/Quantities/Level.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Level.g.cs @@ -452,10 +452,10 @@ public bool Equals(Level other, double tolerance, ComparisonType comparisonType) if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitDecibels(); - double otherBaseValue = (double)other.AsBaseUnitDecibels(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs index e207683a38..c2facd29bb 100644 --- a/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs @@ -477,10 +477,10 @@ public bool Equals(LinearDensity other, double tolerance, ComparisonType compari if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitKilogramsPerMeter(); - double otherBaseValue = (double)other.AsBaseUnitKilogramsPerMeter(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.g.cs index 7d7c0c2a2b..ed5325d29e 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.g.cs @@ -411,10 +411,10 @@ public bool Equals(LuminousFlux other, double tolerance, ComparisonType comparis if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitLumens(); - double otherBaseValue = (double)other.AsBaseUnitLumens(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs index 7dc76085b5..b709fe9d56 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs @@ -411,10 +411,10 @@ public bool Equals(LuminousIntensity other, double tolerance, ComparisonType com if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitCandela(); - double otherBaseValue = (double)other.AsBaseUnitCandela(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticField.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticField.g.cs index 53ddb0b4e8..14bae7ad6c 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticField.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticField.g.cs @@ -411,10 +411,10 @@ public bool Equals(MagneticField other, double tolerance, ComparisonType compari if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitTeslas(); - double otherBaseValue = (double)other.AsBaseUnitTeslas(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.g.cs index 8929469a8c..52d8e6d98f 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.g.cs @@ -411,10 +411,10 @@ public bool Equals(MagneticFlux other, double tolerance, ComparisonType comparis if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitWebers(); - double otherBaseValue = (double)other.AsBaseUnitWebers(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Magnetization.g.cs b/UnitsNet/GeneratedCode/Quantities/Magnetization.g.cs index 65ee7026f6..4792b501ff 100644 --- a/UnitsNet/GeneratedCode/Quantities/Magnetization.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Magnetization.g.cs @@ -411,10 +411,10 @@ public bool Equals(Magnetization other, double tolerance, ComparisonType compari if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitAmperesPerMeter(); - double otherBaseValue = (double)other.AsBaseUnitAmperesPerMeter(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Mass.g.cs b/UnitsNet/GeneratedCode/Quantities/Mass.g.cs index ebfda21878..e4bb1c8777 100644 --- a/UnitsNet/GeneratedCode/Quantities/Mass.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Mass.g.cs @@ -1071,10 +1071,10 @@ public bool Equals(Mass other, double tolerance, ComparisonType comparisonType) if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitKilograms(); - double otherBaseValue = (double)other.AsBaseUnitKilograms(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs index 54126f7346..aee2ad4715 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs @@ -873,10 +873,10 @@ public bool Equals(MassFlow other, double tolerance, ComparisonType comparisonTy if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitGramsPerSecond(); - double otherBaseValue = (double)other.AsBaseUnitGramsPerSecond(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs index d46ebf5538..ded41241d1 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs @@ -444,10 +444,10 @@ public bool Equals(MassFlux other, double tolerance, ComparisonType comparisonTy if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitKilogramsPerSecondPerSquareMeter(); - double otherBaseValue = (double)other.AsBaseUnitKilogramsPerSecondPerSquareMeter(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.g.cs b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.g.cs index 317f0e0851..8543c8130d 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.g.cs @@ -1236,10 +1236,10 @@ public bool Equals(MassMomentOfInertia other, double tolerance, ComparisonType c if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitKilogramSquareMeters(); - double otherBaseValue = (double)other.AsBaseUnitKilogramSquareMeters(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.g.cs index 590dee926f..5d1fd1452b 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.g.cs @@ -477,10 +477,10 @@ public bool Equals(MolarEnergy other, double tolerance, ComparisonType compariso if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitJoulesPerMole(); - double otherBaseValue = (double)other.AsBaseUnitJoulesPerMole(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.g.cs index da71c8c561..1162c84e36 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.g.cs @@ -477,10 +477,10 @@ public bool Equals(MolarEntropy other, double tolerance, ComparisonType comparis if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitJoulesPerMoleKelvin(); - double otherBaseValue = (double)other.AsBaseUnitJoulesPerMoleKelvin(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs index da231984dd..351816b5e5 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs @@ -774,10 +774,10 @@ public bool Equals(MolarMass other, double tolerance, ComparisonType comparisonT if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitKilogramsPerMole(); - double otherBaseValue = (double)other.AsBaseUnitKilogramsPerMole(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs b/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs index 6393482bc5..a41fca5096 100644 --- a/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs @@ -642,10 +642,10 @@ public bool Equals(Molarity other, double tolerance, ComparisonType comparisonTy if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitMolesPerCubicMeter(); - double otherBaseValue = (double)other.AsBaseUnitMolesPerCubicMeter(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Permeability.g.cs b/UnitsNet/GeneratedCode/Quantities/Permeability.g.cs index fafe236a55..9eb2a3052f 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permeability.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permeability.g.cs @@ -411,10 +411,10 @@ public bool Equals(Permeability other, double tolerance, ComparisonType comparis if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitHenriesPerMeter(); - double otherBaseValue = (double)other.AsBaseUnitHenriesPerMeter(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Permittivity.g.cs b/UnitsNet/GeneratedCode/Quantities/Permittivity.g.cs index 6ba4044bc2..93dc1ea117 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permittivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permittivity.g.cs @@ -411,10 +411,10 @@ public bool Equals(Permittivity other, double tolerance, ComparisonType comparis if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitFaradsPerMeter(); - double otherBaseValue = (double)other.AsBaseUnitFaradsPerMeter(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Power.g.cs b/UnitsNet/GeneratedCode/Quantities/Power.g.cs index 9b3e6a9636..8e6243042f 100644 --- a/UnitsNet/GeneratedCode/Quantities/Power.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Power.g.cs @@ -1035,10 +1035,10 @@ public bool Equals(Power other, double tolerance, ComparisonType comparisonType) if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitWatts(); - double otherBaseValue = (double)other.AsBaseUnitWatts(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs index cb9ed62598..58dcc0abd6 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs @@ -1830,10 +1830,10 @@ public bool Equals(PowerDensity other, double tolerance, ComparisonType comparis if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitWattsPerCubicMeter(); - double otherBaseValue = (double)other.AsBaseUnitWattsPerCubicMeter(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/PowerRatio.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerRatio.g.cs index 9009f33418..c3ceb197da 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerRatio.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerRatio.g.cs @@ -452,10 +452,10 @@ public bool Equals(PowerRatio other, double tolerance, ComparisonType comparison if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitDecibelWatts(); - double otherBaseValue = (double)other.AsBaseUnitDecibelWatts(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs b/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs index e42608986c..e237a49e08 100644 --- a/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs @@ -1633,10 +1633,10 @@ public bool Equals(Pressure other, double tolerance, ComparisonType comparisonTy if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitPascals(); - double otherBaseValue = (double)other.AsBaseUnitPascals(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs index a6caf7c390..95f26e82e1 100644 --- a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs @@ -510,10 +510,10 @@ public bool Equals(PressureChangeRate other, double tolerance, ComparisonType co if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitPascalsPerSecond(); - double otherBaseValue = (double)other.AsBaseUnitPascalsPerSecond(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs b/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs index de44e711eb..edee8a3646 100644 --- a/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs @@ -576,10 +576,10 @@ public bool Equals(Ratio other, double tolerance, ComparisonType comparisonType) if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitDecimalFractions(); - double otherBaseValue = (double)other.AsBaseUnitDecimalFractions(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.g.cs index edf8bf9f3d..a0138e023b 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.g.cs @@ -477,10 +477,10 @@ public bool Equals(ReactiveEnergy other, double tolerance, ComparisonType compar if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitVoltampereReactiveHours(); - double otherBaseValue = (double)other.AsBaseUnitVoltampereReactiveHours(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ReactivePower.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactivePower.g.cs index eb24ac548f..7888ad3964 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactivePower.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactivePower.g.cs @@ -510,10 +510,10 @@ public bool Equals(ReactivePower other, double tolerance, ComparisonType compari if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitVoltamperesReactive(); - double otherBaseValue = (double)other.AsBaseUnitVoltamperesReactive(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.g.cs index 51600eecb8..f31d133324 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.g.cs @@ -477,10 +477,10 @@ public bool Equals(RotationalAcceleration other, double tolerance, ComparisonTyp if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitRadiansPerSecondSquared(); - double otherBaseValue = (double)other.AsBaseUnitRadiansPerSecondSquared(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs index 6cbead3702..8f198f08bb 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs @@ -807,10 +807,10 @@ public bool Equals(RotationalSpeed other, double tolerance, ComparisonType compa if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitRadiansPerSecond(); - double otherBaseValue = (double)other.AsBaseUnitRadiansPerSecond(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs index 4696a2c5a2..34372cdc7a 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs @@ -477,10 +477,10 @@ public bool Equals(RotationalStiffness other, double tolerance, ComparisonType c if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitNewtonMetersPerRadian(); - double otherBaseValue = (double)other.AsBaseUnitNewtonMetersPerRadian(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs index 8e63434dc6..2c52743650 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs @@ -477,10 +477,10 @@ public bool Equals(RotationalStiffnessPerLength other, double tolerance, Compari if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitNewtonMetersPerRadianPerMeter(); - double otherBaseValue = (double)other.AsBaseUnitNewtonMetersPerRadianPerMeter(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/SolidAngle.g.cs b/UnitsNet/GeneratedCode/Quantities/SolidAngle.g.cs index 94727b1536..f7cfc490fa 100644 --- a/UnitsNet/GeneratedCode/Quantities/SolidAngle.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SolidAngle.g.cs @@ -411,10 +411,10 @@ public bool Equals(SolidAngle other, double tolerance, ComparisonType comparison if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitSteradians(); - double otherBaseValue = (double)other.AsBaseUnitSteradians(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs index bc778fd65f..bd0bef8e41 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs @@ -642,10 +642,10 @@ public bool Equals(SpecificEnergy other, double tolerance, ComparisonType compar if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitJoulesPerKilogram(); - double otherBaseValue = (double)other.AsBaseUnitJoulesPerKilogram(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs index 860c96cf93..605ce0b1e7 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs @@ -642,10 +642,10 @@ public bool Equals(SpecificEntropy other, double tolerance, ComparisonType compa if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitJoulesPerKilogramKelvin(); - double otherBaseValue = (double)other.AsBaseUnitJoulesPerKilogramKelvin(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs index 80690bb580..c781d45963 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs @@ -411,10 +411,10 @@ public bool Equals(SpecificVolume other, double tolerance, ComparisonType compar if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitCubicMetersPerKilogram(); - double otherBaseValue = (double)other.AsBaseUnitCubicMetersPerKilogram(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs index 0d19dc78f3..63bc013f54 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs @@ -939,10 +939,10 @@ public bool Equals(SpecificWeight other, double tolerance, ComparisonType compar if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitNewtonsPerCubicMeter(); - double otherBaseValue = (double)other.AsBaseUnitNewtonsPerCubicMeter(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Speed.g.cs b/UnitsNet/GeneratedCode/Quantities/Speed.g.cs index 102d50497c..63226661ab 100644 --- a/UnitsNet/GeneratedCode/Quantities/Speed.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Speed.g.cs @@ -1434,10 +1434,10 @@ public bool Equals(Speed other, double tolerance, ComparisonType comparisonType) if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitMetersPerSecond(); - double otherBaseValue = (double)other.AsBaseUnitMetersPerSecond(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Temperature.g.cs b/UnitsNet/GeneratedCode/Quantities/Temperature.g.cs index a44d84a4c3..69f81f2886 100644 --- a/UnitsNet/GeneratedCode/Quantities/Temperature.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Temperature.g.cs @@ -600,10 +600,10 @@ public bool Equals(Temperature other, double tolerance, ComparisonType compariso if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitKelvins(); - double otherBaseValue = (double)other.AsBaseUnitKelvins(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.g.cs index fcec152445..a74fddd88d 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.g.cs @@ -708,10 +708,10 @@ public bool Equals(TemperatureChangeRate other, double tolerance, ComparisonType if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitDegreesCelsiusPerSecond(); - double otherBaseValue = (double)other.AsBaseUnitDegreesCelsiusPerSecond(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs index e2cde94add..b2f577eec5 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs @@ -914,10 +914,10 @@ public bool Equals(TemperatureDelta other, double tolerance, ComparisonType comp if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitKelvins(); - double otherBaseValue = (double)other.AsBaseUnitKelvins(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.g.cs index ea700c3d0e..ffbbcd1003 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.g.cs @@ -444,10 +444,10 @@ public bool Equals(ThermalConductivity other, double tolerance, ComparisonType c if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitWattsPerMeterKelvin(); - double otherBaseValue = (double)other.AsBaseUnitWattsPerMeterKelvin(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.g.cs index 07ed56d91b..b00e9311ff 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.g.cs @@ -543,10 +543,10 @@ public bool Equals(ThermalResistance other, double tolerance, ComparisonType com if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitSquareMeterKelvinsPerKilowatt(); - double otherBaseValue = (double)other.AsBaseUnitSquareMeterKelvinsPerKilowatt(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Torque.g.cs b/UnitsNet/GeneratedCode/Quantities/Torque.g.cs index 3a59394f68..28ad7c0123 100644 --- a/UnitsNet/GeneratedCode/Quantities/Torque.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Torque.g.cs @@ -1071,10 +1071,10 @@ public bool Equals(Torque other, double tolerance, ComparisonType comparisonType if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitNewtonMeters(); - double otherBaseValue = (double)other.AsBaseUnitNewtonMeters(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/VitaminA.g.cs b/UnitsNet/GeneratedCode/Quantities/VitaminA.g.cs index 440f86dc3b..af65bf1f5d 100644 --- a/UnitsNet/GeneratedCode/Quantities/VitaminA.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VitaminA.g.cs @@ -411,10 +411,10 @@ public bool Equals(VitaminA other, double tolerance, ComparisonType comparisonTy if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitInternationalUnits(); - double otherBaseValue = (double)other.AsBaseUnitInternationalUnits(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/Volume.g.cs b/UnitsNet/GeneratedCode/Quantities/Volume.g.cs index 726c5f9961..a35d9b02fa 100644 --- a/UnitsNet/GeneratedCode/Quantities/Volume.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Volume.g.cs @@ -1832,10 +1832,10 @@ public bool Equals(Volume other, double tolerance, ComparisonType comparisonType if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitCubicMeters(); - double otherBaseValue = (double)other.AsBaseUnitCubicMeters(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs index da076bdbbe..cc79b8f851 100644 --- a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs @@ -1170,10 +1170,10 @@ public bool Equals(VolumeFlow other, double tolerance, ComparisonType comparison if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnitCubicMetersPerSecond(); - double otherBaseValue = (double)other.AsBaseUnitCubicMetersPerSecond(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// diff --git a/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 b/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 index 6745fa0528..f68681776b 100644 --- a/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 +++ b/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 @@ -461,10 +461,10 @@ namespace UnitsNet if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); - double baseValue = (double)AsBaseUnit$baseUnitPluralName(); - double otherBaseValue = (double)other.AsBaseUnit$baseUnitPluralName(); + double thisValue = (double)this.Value; + double otherValueInThisUnits = other.As(this.Unit); - return UnitsNet.Comparison.Equals(baseValue, otherBaseValue, tolerance, comparisonType); + return UnitsNet.Comparison.Equals(thisValue, otherValueInThisUnits, tolerance, comparisonType); } /// From 490e5af0fc14b2977a13241ddede2ab4ea132f25 Mon Sep 17 00:00:00 2001 From: Tristan Milnthorp Date: Thu, 21 Jun 2018 16:26:38 -0400 Subject: [PATCH 10/19] Windows runtime component haunts me :). Fix for now allowing a parameter with name "value" --- UnitsNet/Comparison.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/UnitsNet/Comparison.cs b/UnitsNet/Comparison.cs index efd44d70ca..6b3ba23807 100644 --- a/UnitsNet/Comparison.cs +++ b/UnitsNet/Comparison.cs @@ -31,11 +31,11 @@ public sealed class Comparison /// Absolute tolerance is when the absolute difference between the two values is not greater than the tolerance value. /// /// The first value. If using relative tolerance, it is the value which the relative tolerance will be calculated against. - /// The value to compare to. + /// The value to compare to. /// The absolute or relative tolerance value. /// Whether to use tolerance as an absolute or relative tolerance. /// - public static bool Equals(double referenceValue, double value, double tolerance, ComparisonType comparisonType) + public static bool Equals(double referenceValue, double otherValue, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); @@ -43,9 +43,9 @@ public static bool Equals(double referenceValue, double value, double tolerance, switch(comparisonType) { case ComparisonType.Relative: - return EqualsRelative(referenceValue, value, tolerance); + return EqualsRelative(referenceValue, otherValue, tolerance); case ComparisonType.Absolute: - return EqualsAbsolute(referenceValue, value, tolerance); + return EqualsAbsolute(referenceValue, otherValue, tolerance); default: throw new InvalidOperationException("The given ComparisonType is not supported."); } @@ -56,16 +56,16 @@ public static bool Equals(double referenceValue, double value, double tolerance, /// Relative tolerance is when the difference between the two values is not greater than referenceValue * tolerance. /// /// The reference value which the tolerance will be calculated against. - /// The value to compare to. + /// The value to compare to. /// /// True if the two values are equal within the given relative tolerance, otherwise false. - public static bool EqualsRelative(double referenceValue, double value, double tolerance) + public static bool EqualsRelative(double referenceValue, double otherValue, double tolerance) { if(tolerance < 0) throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); double maxVariation = Math.Abs(referenceValue * tolerance); - return Math.Abs(referenceValue - value) <= maxVariation; + return Math.Abs(referenceValue - otherValue) <= maxVariation; } /// From 2a50b7248008558b501f2ddcae2a4ebfcdaf9dd8 Mon Sep 17 00:00:00 2001 From: Tristan Milnthorp Date: Fri, 22 Jun 2018 12:02:52 -0400 Subject: [PATCH 11/19] Whitespace fix --- UnitsNet.Tests/CustomCode/AngleTests.cs | 2 +- UnitsNet.Tests/CustomCode/ForceTests.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/UnitsNet.Tests/CustomCode/AngleTests.cs b/UnitsNet.Tests/CustomCode/AngleTests.cs index 02708e8abb..364c3f96bc 100644 --- a/UnitsNet.Tests/CustomCode/AngleTests.cs +++ b/UnitsNet.Tests/CustomCode/AngleTests.cs @@ -54,7 +54,7 @@ public class AngleTests : AngleTestsBase protected override double RevolutionsInOneDegree => 2.777777777777777e-3; - [ Fact] + [Fact] public void AngleDividedByDurationEqualsRotationalSpeed() { RotationalSpeed rotationalSpeed = Angle.FromRadians(10) / Duration.FromSeconds(5); diff --git a/UnitsNet.Tests/CustomCode/ForceTests.cs b/UnitsNet.Tests/CustomCode/ForceTests.cs index d24909ead7..fb348634a8 100644 --- a/UnitsNet.Tests/CustomCode/ForceTests.cs +++ b/UnitsNet.Tests/CustomCode/ForceTests.cs @@ -43,7 +43,7 @@ public class ForceTests : ForceTestsBase protected override double TonnesForceInOneNewton => 1.019716212977928e-4; - [ Fact] + [Fact] public void ForceDividedByAreaEqualsPressure() { Pressure pressure = Force.FromNewtons(90)/Area.FromSquareMeters(9); From 241cabca0bd4dd442ed95da5a839880eef502704 Mon Sep 17 00:00:00 2001 From: Tristan Milnthorp Date: Mon, 25 Jun 2018 08:46:25 -0400 Subject: [PATCH 12/19] Making Comparison class static --- UnitsNet/Comparison.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UnitsNet/Comparison.cs b/UnitsNet/Comparison.cs index 6b3ba23807..23cdb596e5 100644 --- a/UnitsNet/Comparison.cs +++ b/UnitsNet/Comparison.cs @@ -23,7 +23,7 @@ namespace UnitsNet { - public sealed class Comparison + public static class Comparison { /// /// Checks if two values are equal with a given relative or absolute tolerance. From 06164a3245f085120bfdbbba40400ff9e8fc036f Mon Sep 17 00:00:00 2001 From: Tristan Milnthorp Date: Mon, 25 Jun 2018 09:23:39 -0400 Subject: [PATCH 13/19] Updating documentation. Call EqualsAbsolute from Equals($quantityName other, $quantityName maxError) --- UnitsNet/Comparison.cs | 30 +++++++++++++------ .../Quantities/Acceleration.g.cs | 18 ++++++++--- .../Quantities/AmountOfSubstance.g.cs | 18 ++++++++--- .../Quantities/AmplitudeRatio.g.cs | 18 ++++++++--- UnitsNet/GeneratedCode/Quantities/Angle.g.cs | 18 ++++++++--- .../Quantities/ApparentEnergy.g.cs | 18 ++++++++--- .../Quantities/ApparentPower.g.cs | 18 ++++++++--- UnitsNet/GeneratedCode/Quantities/Area.g.cs | 18 ++++++++--- .../GeneratedCode/Quantities/AreaDensity.g.cs | 18 ++++++++--- .../Quantities/AreaMomentOfInertia.g.cs | 18 ++++++++--- .../GeneratedCode/Quantities/BitRate.g.cs | 18 ++++++++--- .../BrakeSpecificFuelConsumption.g.cs | 18 ++++++++--- .../GeneratedCode/Quantities/Capacitance.g.cs | 18 ++++++++--- .../GeneratedCode/Quantities/Density.g.cs | 18 ++++++++--- .../GeneratedCode/Quantities/Duration.g.cs | 18 ++++++++--- .../Quantities/DynamicViscosity.g.cs | 18 ++++++++--- .../Quantities/ElectricAdmittance.g.cs | 18 ++++++++--- .../Quantities/ElectricCharge.g.cs | 18 ++++++++--- .../Quantities/ElectricChargeDensity.g.cs | 18 ++++++++--- .../Quantities/ElectricConductance.g.cs | 18 ++++++++--- .../Quantities/ElectricConductivity.g.cs | 18 ++++++++--- .../Quantities/ElectricCurrent.g.cs | 18 ++++++++--- .../Quantities/ElectricCurrentDensity.g.cs | 18 ++++++++--- .../Quantities/ElectricCurrentGradient.g.cs | 18 ++++++++--- .../Quantities/ElectricField.g.cs | 18 ++++++++--- .../Quantities/ElectricInductance.g.cs | 18 ++++++++--- .../Quantities/ElectricPotential.g.cs | 18 ++++++++--- .../Quantities/ElectricPotentialAc.g.cs | 18 ++++++++--- .../Quantities/ElectricPotentialDc.g.cs | 18 ++++++++--- .../Quantities/ElectricResistance.g.cs | 18 ++++++++--- .../Quantities/ElectricResistivity.g.cs | 18 ++++++++--- UnitsNet/GeneratedCode/Quantities/Energy.g.cs | 18 ++++++++--- .../GeneratedCode/Quantities/Entropy.g.cs | 18 ++++++++--- UnitsNet/GeneratedCode/Quantities/Flow.g.cs | 18 ++++++++--- UnitsNet/GeneratedCode/Quantities/Force.g.cs | 18 ++++++++--- .../Quantities/ForceChangeRate.g.cs | 18 ++++++++--- .../Quantities/ForcePerLength.g.cs | 18 ++++++++--- .../GeneratedCode/Quantities/Frequency.g.cs | 18 ++++++++--- .../GeneratedCode/Quantities/HeatFlux.g.cs | 18 ++++++++--- .../Quantities/HeatTransferCoefficient.g.cs | 18 ++++++++--- .../GeneratedCode/Quantities/Illuminance.g.cs | 18 ++++++++--- .../GeneratedCode/Quantities/Information.g.cs | 18 ++++++++--- .../GeneratedCode/Quantities/Irradiance.g.cs | 18 ++++++++--- .../GeneratedCode/Quantities/Irradiation.g.cs | 18 ++++++++--- .../Quantities/KinematicViscosity.g.cs | 18 ++++++++--- .../GeneratedCode/Quantities/LapseRate.g.cs | 18 ++++++++--- UnitsNet/GeneratedCode/Quantities/Length.g.cs | 18 ++++++++--- UnitsNet/GeneratedCode/Quantities/Level.g.cs | 18 ++++++++--- .../Quantities/LinearDensity.g.cs | 18 ++++++++--- .../Quantities/LuminousFlux.g.cs | 18 ++++++++--- .../Quantities/LuminousIntensity.g.cs | 18 ++++++++--- .../Quantities/MagneticField.g.cs | 18 ++++++++--- .../Quantities/MagneticFlux.g.cs | 18 ++++++++--- .../Quantities/Magnetization.g.cs | 18 ++++++++--- UnitsNet/GeneratedCode/Quantities/Mass.g.cs | 18 ++++++++--- .../GeneratedCode/Quantities/MassFlow.g.cs | 18 ++++++++--- .../GeneratedCode/Quantities/MassFlux.g.cs | 18 ++++++++--- .../Quantities/MassMomentOfInertia.g.cs | 18 ++++++++--- .../GeneratedCode/Quantities/MolarEnergy.g.cs | 18 ++++++++--- .../Quantities/MolarEntropy.g.cs | 18 ++++++++--- .../GeneratedCode/Quantities/MolarMass.g.cs | 18 ++++++++--- .../GeneratedCode/Quantities/Molarity.g.cs | 18 ++++++++--- .../Quantities/Permeability.g.cs | 18 ++++++++--- .../Quantities/Permittivity.g.cs | 18 ++++++++--- UnitsNet/GeneratedCode/Quantities/Power.g.cs | 18 ++++++++--- .../Quantities/PowerDensity.g.cs | 18 ++++++++--- .../GeneratedCode/Quantities/PowerRatio.g.cs | 18 ++++++++--- .../GeneratedCode/Quantities/Pressure.g.cs | 18 ++++++++--- .../Quantities/PressureChangeRate.g.cs | 18 ++++++++--- UnitsNet/GeneratedCode/Quantities/Ratio.g.cs | 18 ++++++++--- .../Quantities/ReactiveEnergy.g.cs | 18 ++++++++--- .../Quantities/ReactivePower.g.cs | 18 ++++++++--- .../Quantities/RotationalAcceleration.g.cs | 18 ++++++++--- .../Quantities/RotationalSpeed.g.cs | 18 ++++++++--- .../Quantities/RotationalStiffness.g.cs | 18 ++++++++--- .../RotationalStiffnessPerLength.g.cs | 18 ++++++++--- .../GeneratedCode/Quantities/SolidAngle.g.cs | 18 ++++++++--- .../Quantities/SpecificEnergy.g.cs | 18 ++++++++--- .../Quantities/SpecificEntropy.g.cs | 18 ++++++++--- .../Quantities/SpecificVolume.g.cs | 18 ++++++++--- .../Quantities/SpecificWeight.g.cs | 18 ++++++++--- UnitsNet/GeneratedCode/Quantities/Speed.g.cs | 18 ++++++++--- .../GeneratedCode/Quantities/Temperature.g.cs | 18 ++++++++--- .../Quantities/TemperatureChangeRate.g.cs | 18 ++++++++--- .../Quantities/TemperatureDelta.g.cs | 18 ++++++++--- .../Quantities/ThermalConductivity.g.cs | 18 ++++++++--- .../Quantities/ThermalResistance.g.cs | 18 ++++++++--- UnitsNet/GeneratedCode/Quantities/Torque.g.cs | 18 ++++++++--- .../GeneratedCode/Quantities/VitaminA.g.cs | 18 ++++++++--- UnitsNet/GeneratedCode/Quantities/Volume.g.cs | 18 ++++++++--- .../GeneratedCode/Quantities/VolumeFlow.g.cs | 18 ++++++++--- .../Include-GenerateQuantitySourceCode.ps1 | 24 +++++++++++---- 92 files changed, 1300 insertions(+), 374 deletions(-) diff --git a/UnitsNet/Comparison.cs b/UnitsNet/Comparison.cs index 23cdb596e5..c945024e8c 100644 --- a/UnitsNet/Comparison.cs +++ b/UnitsNet/Comparison.cs @@ -26,14 +26,23 @@ namespace UnitsNet public static class Comparison { /// + /// /// Checks if two values are equal with a given relative or absolute tolerance. - /// Relative tolerance is when the difference between the two values is not greater than referenceValue * tolerance. - /// Absolute tolerance is when the absolute difference between the two values is not greater than the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between and + /// as a percentage of . For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between and + /// as a fixed number. + /// /// - /// The first value. If using relative tolerance, it is the value which the relative tolerance will be calculated against. + /// The reference value. If using relative tolerance, it is the value which the relative tolerance will be calculated against. /// The value to compare to. - /// The absolute or relative tolerance value. - /// Whether to use tolerance as an absolute or relative tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. + /// Whether the tolerance is absolute or relative. /// public static bool Equals(double referenceValue, double otherValue, double tolerance, ComparisonType comparisonType) { @@ -52,12 +61,14 @@ public static bool Equals(double referenceValue, double otherValue, double toler } /// - /// Checks if two values are equal with a given relative tolerance. The relative tolerance is calculated against the referenceValue parameter. - /// Relative tolerance is when the difference between the two values is not greater than referenceValue * tolerance. + /// Checks if two values are equal with a given relative tolerance. + /// Relative tolerance is defined as the maximum allowable difference between and + /// as a percentage of . For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of to be considered equal. /// /// The reference value which the tolerance will be calculated against. /// The value to compare to. - /// + /// The relative tolerance. Must be greater than 0. /// True if the two values are equal within the given relative tolerance, otherwise false. public static bool EqualsRelative(double referenceValue, double otherValue, double tolerance) { @@ -70,7 +81,8 @@ public static bool EqualsRelative(double referenceValue, double otherValue, doub /// /// Checks if two values are equal with a given absolute tolerance. - /// Absolute tolerance is when the absolute difference between the two values is not greater than the tolerance value. + /// Absolute tolerance is defined as the maximum allowable absolute difference between and + /// as a fixed number. /// /// The first value. /// The second value. diff --git a/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs b/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs index b92b2d6a93..018e031c0a 100644 --- a/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs @@ -791,15 +791,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another Acceleration within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Acceleration other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs index 7bc590b96f..3a6e44cd9f 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs @@ -824,15 +824,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another AmountOfSubstance within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(AmountOfSubstance other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs index f1b1a0733b..d298fdeb29 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs @@ -502,15 +502,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another AmplitudeRatio within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(AmplitudeRatio other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/Angle.g.cs b/UnitsNet/GeneratedCode/Quantities/Angle.g.cs index 074818f683..5bee5ff28e 100644 --- a/UnitsNet/GeneratedCode/Quantities/Angle.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Angle.g.cs @@ -824,15 +824,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another Angle within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Angle other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs index d2c0dc1d31..c8a1e28f18 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs @@ -461,15 +461,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another ApparentEnergy within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ApparentEnergy other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs index aefbfbaabe..bc18c617eb 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs @@ -494,15 +494,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another ApparentPower within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ApparentPower other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/Area.g.cs b/UnitsNet/GeneratedCode/Quantities/Area.g.cs index 1de05f06a6..e407e9d464 100644 --- a/UnitsNet/GeneratedCode/Quantities/Area.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Area.g.cs @@ -791,15 +791,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another Area within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Area other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs index 892f70c197..60a770b841 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs @@ -395,15 +395,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another AreaDensity within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(AreaDensity other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs index 084acecf97..cbd76bd43d 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs @@ -560,15 +560,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another AreaMomentOfInertia within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(AreaMomentOfInertia other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/BitRate.g.cs b/UnitsNet/GeneratedCode/Quantities/BitRate.g.cs index b27b26e9e5..82634f61e1 100644 --- a/UnitsNet/GeneratedCode/Quantities/BitRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BitRate.g.cs @@ -1217,15 +1217,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another BitRate within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(BitRate other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs index 3b7b690b19..a95acd5141 100644 --- a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs @@ -461,15 +461,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another BrakeSpecificFuelConsumption within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(BrakeSpecificFuelConsumption other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/Capacitance.g.cs b/UnitsNet/GeneratedCode/Quantities/Capacitance.g.cs index 4b676be90a..6717bdafc2 100644 --- a/UnitsNet/GeneratedCode/Quantities/Capacitance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Capacitance.g.cs @@ -395,15 +395,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another Capacitance within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Capacitance other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/Density.g.cs b/UnitsNet/GeneratedCode/Quantities/Density.g.cs index 0a2d6e6b90..5d5900b25b 100644 --- a/UnitsNet/GeneratedCode/Quantities/Density.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Density.g.cs @@ -1616,15 +1616,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another Density within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Density other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/Duration.g.cs b/UnitsNet/GeneratedCode/Quantities/Duration.g.cs index 388631b5a6..9d1e8908b2 100644 --- a/UnitsNet/GeneratedCode/Quantities/Duration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Duration.g.cs @@ -760,15 +760,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another Duration within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Duration other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs index 9a29ab7090..63251e41d9 100644 --- a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs @@ -560,15 +560,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another DynamicViscosity within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(DynamicViscosity other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs index 42b5cd8167..00cf14fc7c 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs @@ -494,15 +494,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another ElectricAdmittance within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ElectricAdmittance other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs index 3a6589f332..f7c5143029 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs @@ -395,15 +395,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another ElectricCharge within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ElectricCharge other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs index 414e0265bf..4b85a038e9 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs @@ -395,15 +395,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another ElectricChargeDensity within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ElectricChargeDensity other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs index 255e95256e..da7d5424da 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs @@ -461,15 +461,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another ElectricConductance within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ElectricConductance other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs index e987a4d16e..b7d97979c9 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs @@ -395,15 +395,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another ElectricConductivity within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ElectricConductivity other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs index 1e09fd6c53..a118c4eafb 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs @@ -593,15 +593,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another ElectricCurrent within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ElectricCurrent other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs index 097cdf484a..fa57148ba6 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs @@ -395,15 +395,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another ElectricCurrentDensity within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ElectricCurrentDensity other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs index 240b078ff2..d44a6984b1 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs @@ -395,15 +395,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another ElectricCurrentGradient within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ElectricCurrentGradient other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs index baa14a850e..a709775151 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs @@ -395,15 +395,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another ElectricField within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ElectricField other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs index 1254073505..b03bbf06de 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs @@ -395,15 +395,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another ElectricInductance within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ElectricInductance other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs index 13ad755da6..d349173557 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs @@ -527,15 +527,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another ElectricPotential within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ElectricPotential other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.g.cs index 1809af7b54..0ca64d660f 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.g.cs @@ -527,15 +527,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another ElectricPotentialAc within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ElectricPotentialAc other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.g.cs index 9d4ed76045..87264e575d 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.g.cs @@ -527,15 +527,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another ElectricPotentialDc within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ElectricPotentialDc other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs index 8f869309d7..b4fb6f2b70 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs @@ -494,15 +494,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another ElectricResistance within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ElectricResistance other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs index 7971153533..a29bd15504 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs @@ -494,15 +494,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another ElectricResistivity within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ElectricResistivity other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/Energy.g.cs b/UnitsNet/GeneratedCode/Quantities/Energy.g.cs index 8164feedc3..aacdd26042 100644 --- a/UnitsNet/GeneratedCode/Quantities/Energy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Energy.g.cs @@ -1088,15 +1088,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another Energy within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Energy other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs b/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs index ad899e9a78..1038dc70bc 100644 --- a/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs @@ -593,15 +593,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another Entropy within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Entropy other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/Flow.g.cs b/UnitsNet/GeneratedCode/Quantities/Flow.g.cs index d7dd97fd46..2825d880c1 100644 --- a/UnitsNet/GeneratedCode/Quantities/Flow.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Flow.g.cs @@ -1172,15 +1172,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another Flow within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Flow other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/Force.g.cs b/UnitsNet/GeneratedCode/Quantities/Force.g.cs index 249071289b..e852ff3d80 100644 --- a/UnitsNet/GeneratedCode/Quantities/Force.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Force.g.cs @@ -692,15 +692,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another Force within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Force other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs index 5366f9189e..9088dc39fc 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs @@ -725,15 +725,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another ForceChangeRate within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ForceChangeRate other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs index f5c931dec3..07f5a7d9db 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs @@ -659,15 +659,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another ForcePerLength within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ForcePerLength other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs b/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs index c7e772410e..270488c2c5 100644 --- a/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs @@ -626,15 +626,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another Frequency within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Frequency other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs index 830293fe24..984e75154f 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs @@ -890,15 +890,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another HeatFlux within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(HeatFlux other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs index 5f466d2fcf..df0b1fd2aa 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs @@ -428,15 +428,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another HeatTransferCoefficient within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(HeatTransferCoefficient other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs b/UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs index 7767a1f893..3b4cf1e3fa 100644 --- a/UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs @@ -494,15 +494,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another Illuminance within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Illuminance other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/Information.g.cs b/UnitsNet/GeneratedCode/Quantities/Information.g.cs index d987c96185..e3a5cad119 100644 --- a/UnitsNet/GeneratedCode/Quantities/Information.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Information.g.cs @@ -1217,15 +1217,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another Information within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Information other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs index 9ada92f1bc..e69b62c0a8 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs @@ -428,15 +428,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another Irradiance within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Irradiance other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs index deb55e179b..9bbc40e903 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs @@ -461,15 +461,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another Irradiation within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Irradiation other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs index 442f8f2930..d588f0be50 100644 --- a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs @@ -626,15 +626,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another KinematicViscosity within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(KinematicViscosity other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/LapseRate.g.cs b/UnitsNet/GeneratedCode/Quantities/LapseRate.g.cs index 32779ac005..d4760e8df3 100644 --- a/UnitsNet/GeneratedCode/Quantities/LapseRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LapseRate.g.cs @@ -395,15 +395,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another LapseRate within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(LapseRate other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/Length.g.cs b/UnitsNet/GeneratedCode/Quantities/Length.g.cs index 54552bfcd9..8856f8959a 100644 --- a/UnitsNet/GeneratedCode/Quantities/Length.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Length.g.cs @@ -1088,15 +1088,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another Length within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Length other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/Level.g.cs b/UnitsNet/GeneratedCode/Quantities/Level.g.cs index 97ac894028..71166719c4 100644 --- a/UnitsNet/GeneratedCode/Quantities/Level.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Level.g.cs @@ -436,15 +436,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another Level within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Level other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs index c2facd29bb..182ca614ed 100644 --- a/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs @@ -461,15 +461,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another LinearDensity within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(LinearDensity other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.g.cs index ed5325d29e..34bc5e2dc0 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.g.cs @@ -395,15 +395,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another LuminousFlux within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(LuminousFlux other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs index b709fe9d56..e5895e7377 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs @@ -395,15 +395,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another LuminousIntensity within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(LuminousIntensity other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticField.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticField.g.cs index 14bae7ad6c..82aa5918b4 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticField.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticField.g.cs @@ -395,15 +395,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another MagneticField within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(MagneticField other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.g.cs index 52d8e6d98f..6f2ec5434e 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.g.cs @@ -395,15 +395,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another MagneticFlux within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(MagneticFlux other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/Magnetization.g.cs b/UnitsNet/GeneratedCode/Quantities/Magnetization.g.cs index 4792b501ff..a4d948f661 100644 --- a/UnitsNet/GeneratedCode/Quantities/Magnetization.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Magnetization.g.cs @@ -395,15 +395,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another Magnetization within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Magnetization other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/Mass.g.cs b/UnitsNet/GeneratedCode/Quantities/Mass.g.cs index e4bb1c8777..bc78990985 100644 --- a/UnitsNet/GeneratedCode/Quantities/Mass.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Mass.g.cs @@ -1055,15 +1055,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another Mass within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Mass other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs index aee2ad4715..2f32645118 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs @@ -857,15 +857,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another MassFlow within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(MassFlow other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs index ded41241d1..5ab3529be9 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs @@ -428,15 +428,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another MassFlux within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(MassFlux other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.g.cs b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.g.cs index 8543c8130d..6ebc84c9b3 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.g.cs @@ -1220,15 +1220,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another MassMomentOfInertia within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(MassMomentOfInertia other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.g.cs index 5d1fd1452b..9d9026d787 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.g.cs @@ -461,15 +461,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another MolarEnergy within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(MolarEnergy other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.g.cs index 1162c84e36..9e6e462f53 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.g.cs @@ -461,15 +461,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another MolarEntropy within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(MolarEntropy other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs index 351816b5e5..3eda8ae1a2 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs @@ -758,15 +758,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another MolarMass within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(MolarMass other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs b/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs index a41fca5096..1a4837c7b5 100644 --- a/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs @@ -626,15 +626,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another Molarity within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Molarity other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/Permeability.g.cs b/UnitsNet/GeneratedCode/Quantities/Permeability.g.cs index 9eb2a3052f..e89835ef90 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permeability.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permeability.g.cs @@ -395,15 +395,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another Permeability within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Permeability other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/Permittivity.g.cs b/UnitsNet/GeneratedCode/Quantities/Permittivity.g.cs index 93dc1ea117..40cbefac2b 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permittivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permittivity.g.cs @@ -395,15 +395,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another Permittivity within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Permittivity other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/Power.g.cs b/UnitsNet/GeneratedCode/Quantities/Power.g.cs index 8e6243042f..abde713c71 100644 --- a/UnitsNet/GeneratedCode/Quantities/Power.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Power.g.cs @@ -1019,15 +1019,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another Power within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Power other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs index 58dcc0abd6..3a53aa523e 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs @@ -1814,15 +1814,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another PowerDensity within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(PowerDensity other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/PowerRatio.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerRatio.g.cs index c3ceb197da..d5f84f1f63 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerRatio.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerRatio.g.cs @@ -436,15 +436,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another PowerRatio within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(PowerRatio other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs b/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs index e237a49e08..ef0e7b36d4 100644 --- a/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs @@ -1617,15 +1617,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another Pressure within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Pressure other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs index 95f26e82e1..ab6987d46c 100644 --- a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs @@ -494,15 +494,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another PressureChangeRate within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(PressureChangeRate other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs b/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs index edee8a3646..9bf00139a2 100644 --- a/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs @@ -560,15 +560,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another Ratio within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Ratio other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.g.cs index a0138e023b..33e0a48556 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.g.cs @@ -461,15 +461,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another ReactiveEnergy within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ReactiveEnergy other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/ReactivePower.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactivePower.g.cs index 7888ad3964..c28125ce7c 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactivePower.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactivePower.g.cs @@ -494,15 +494,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another ReactivePower within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ReactivePower other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.g.cs index f31d133324..67b5a64fb1 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.g.cs @@ -461,15 +461,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another RotationalAcceleration within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(RotationalAcceleration other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs index 8f198f08bb..bbb7baec0c 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs @@ -791,15 +791,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another RotationalSpeed within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(RotationalSpeed other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs index 34372cdc7a..86d1956a5d 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs @@ -461,15 +461,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another RotationalStiffness within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(RotationalStiffness other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs index 2c52743650..8747c8f90e 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs @@ -461,15 +461,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another RotationalStiffnessPerLength within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(RotationalStiffnessPerLength other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/SolidAngle.g.cs b/UnitsNet/GeneratedCode/Quantities/SolidAngle.g.cs index f7cfc490fa..d6502071e2 100644 --- a/UnitsNet/GeneratedCode/Quantities/SolidAngle.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SolidAngle.g.cs @@ -395,15 +395,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another SolidAngle within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(SolidAngle other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs index bd0bef8e41..f5e95d55e7 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs @@ -626,15 +626,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another SpecificEnergy within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(SpecificEnergy other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs index 605ce0b1e7..eb74dc3cdb 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs @@ -626,15 +626,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another SpecificEntropy within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(SpecificEntropy other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs index c781d45963..51945999a8 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs @@ -395,15 +395,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another SpecificVolume within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(SpecificVolume other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs index 63bc013f54..3b7f9ee311 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs @@ -923,15 +923,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another SpecificWeight within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(SpecificWeight other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/Speed.g.cs b/UnitsNet/GeneratedCode/Quantities/Speed.g.cs index 63226661ab..c446d89348 100644 --- a/UnitsNet/GeneratedCode/Quantities/Speed.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Speed.g.cs @@ -1418,15 +1418,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another Speed within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Speed other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/Temperature.g.cs b/UnitsNet/GeneratedCode/Quantities/Temperature.g.cs index 69f81f2886..294f4ca95f 100644 --- a/UnitsNet/GeneratedCode/Quantities/Temperature.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Temperature.g.cs @@ -584,15 +584,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another Temperature within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Temperature other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.g.cs index a74fddd88d..0b59fdebb5 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.g.cs @@ -692,15 +692,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another TemperatureChangeRate within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(TemperatureChangeRate other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs index b2f577eec5..10f72e638b 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs @@ -898,15 +898,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another TemperatureDelta within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(TemperatureDelta other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.g.cs index ffbbcd1003..4884543556 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.g.cs @@ -428,15 +428,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another ThermalConductivity within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ThermalConductivity other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.g.cs index b00e9311ff..146c95fa35 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.g.cs @@ -527,15 +527,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another ThermalResistance within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ThermalResistance other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/Torque.g.cs b/UnitsNet/GeneratedCode/Quantities/Torque.g.cs index 28ad7c0123..7beb4652fc 100644 --- a/UnitsNet/GeneratedCode/Quantities/Torque.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Torque.g.cs @@ -1055,15 +1055,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another Torque within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Torque other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/VitaminA.g.cs b/UnitsNet/GeneratedCode/Quantities/VitaminA.g.cs index af65bf1f5d..5fb392324b 100644 --- a/UnitsNet/GeneratedCode/Quantities/VitaminA.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VitaminA.g.cs @@ -395,15 +395,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another VitaminA within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(VitaminA other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/Volume.g.cs b/UnitsNet/GeneratedCode/Quantities/Volume.g.cs index a35d9b02fa..197614041a 100644 --- a/UnitsNet/GeneratedCode/Quantities/Volume.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Volume.g.cs @@ -1816,15 +1816,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another Volume within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Volume other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs index cc79b8f851..29de21e60e 100644 --- a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs @@ -1154,15 +1154,25 @@ public override bool Equals(object obj) } /// + /// /// Compare equality to another VolumeFlow within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(VolumeFlow other, double tolerance, ComparisonType comparisonType) diff --git a/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 b/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 index f68681776b..7da2a35f93 100644 --- a/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 +++ b/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 @@ -445,15 +445,25 @@ namespace UnitsNet } /// + /// /// Compare equality to another $quantityName within the given absolute or relative tolerance. - /// Relative tolerance is when the difference between the two quantities is not greater than the scale of the values compared to the tolerance. - /// If using relative tolerance, this quantity's value will be what the relative tolerance will be calculated against. - /// Absolute tolerance is when the difference between the two quantities is not greater than exactly the tolerance value. + /// + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a percentage of this quantity's value. For example, a relative tolerance + /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// + /// + /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and + /// as a fixed number. + /// + /// /// Note that it is advised against specifying zero difference, due to the nature /// of floating point operations and using System.Double internally. + /// /// /// The other quantity to compare to. - /// The comparison tolerance. + /// The absolute or relative tolerance value. Must be greater than 0. /// The comparison type: either relative or absolute. /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals($quantityName other, double tolerance, ComparisonType comparisonType) @@ -477,7 +487,11 @@ namespace UnitsNet /// True if the difference between the two values is not greater than the specified max. public bool Equals($quantityName other, $quantityName maxError) { - return Math.Abs(AsBaseUnit$baseUnitPluralName() - other.AsBaseUnit$baseUnitPluralName()) <= maxError.AsBaseUnit$baseUnitPluralName(); + var thisInBaseUnits = AsBaseUnit$baseUnitPluralName(); + var otherInBaseUnits = other.AsBaseUnit$baseUnitPluralName(); + var maxErrorInBaseUnits = maxError.AsBaseUnit$baseUnitPluralName(); + + return UnitsNet.Comparison.EqualsAbsolute(thisInBaseUnits, otherInBaseUnits, maxErrorInBaseUnits); } public override int GetHashCode() From 94be7189a3c379087da4d7572d699d75d1e6f8c9 Mon Sep 17 00:00:00 2001 From: Tristan Milnthorp Date: Mon, 25 Jun 2018 09:55:44 -0400 Subject: [PATCH 14/19] Bit by decimal :) --- UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 b/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 index 7da2a35f93..b23c00b87c 100644 --- a/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 +++ b/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 @@ -487,11 +487,7 @@ namespace UnitsNet /// True if the difference between the two values is not greater than the specified max. public bool Equals($quantityName other, $quantityName maxError) { - var thisInBaseUnits = AsBaseUnit$baseUnitPluralName(); - var otherInBaseUnits = other.AsBaseUnit$baseUnitPluralName(); - var maxErrorInBaseUnits = maxError.AsBaseUnit$baseUnitPluralName(); - - return UnitsNet.Comparison.EqualsAbsolute(thisInBaseUnits, otherInBaseUnits, maxErrorInBaseUnits); + return Math.Abs(AsBaseUnit$baseUnitPluralName() - other.AsBaseUnit$baseUnitPluralName()) <= maxError.AsBaseUnit$baseUnitPluralName(); } public override int GetHashCode() From 5c5db3c402315b5179146dc09fa6db71c592cc58 Mon Sep 17 00:00:00 2001 From: Tristan Milnthorp Date: Mon, 25 Jun 2018 17:48:50 -0400 Subject: [PATCH 15/19] Updating documentation to be more clear and provide examples for quantity types --- .../Quantities/Acceleration.g.cs | 24 ++++++++++++++++--- .../Quantities/AmountOfSubstance.g.cs | 24 ++++++++++++++++--- .../Quantities/AmplitudeRatio.g.cs | 24 ++++++++++++++++--- UnitsNet/GeneratedCode/Quantities/Angle.g.cs | 24 ++++++++++++++++--- .../Quantities/ApparentEnergy.g.cs | 24 ++++++++++++++++--- .../Quantities/ApparentPower.g.cs | 24 ++++++++++++++++--- UnitsNet/GeneratedCode/Quantities/Area.g.cs | 24 ++++++++++++++++--- .../GeneratedCode/Quantities/AreaDensity.g.cs | 24 ++++++++++++++++--- .../Quantities/AreaMomentOfInertia.g.cs | 24 ++++++++++++++++--- .../GeneratedCode/Quantities/BitRate.g.cs | 24 ++++++++++++++++--- .../BrakeSpecificFuelConsumption.g.cs | 24 ++++++++++++++++--- .../GeneratedCode/Quantities/Capacitance.g.cs | 24 ++++++++++++++++--- .../GeneratedCode/Quantities/Density.g.cs | 24 ++++++++++++++++--- .../GeneratedCode/Quantities/Duration.g.cs | 24 ++++++++++++++++--- .../Quantities/DynamicViscosity.g.cs | 24 ++++++++++++++++--- .../Quantities/ElectricAdmittance.g.cs | 24 ++++++++++++++++--- .../Quantities/ElectricCharge.g.cs | 24 ++++++++++++++++--- .../Quantities/ElectricChargeDensity.g.cs | 24 ++++++++++++++++--- .../Quantities/ElectricConductance.g.cs | 24 ++++++++++++++++--- .../Quantities/ElectricConductivity.g.cs | 24 ++++++++++++++++--- .../Quantities/ElectricCurrent.g.cs | 24 ++++++++++++++++--- .../Quantities/ElectricCurrentDensity.g.cs | 24 ++++++++++++++++--- .../Quantities/ElectricCurrentGradient.g.cs | 24 ++++++++++++++++--- .../Quantities/ElectricField.g.cs | 24 ++++++++++++++++--- .../Quantities/ElectricInductance.g.cs | 24 ++++++++++++++++--- .../Quantities/ElectricPotential.g.cs | 24 ++++++++++++++++--- .../Quantities/ElectricPotentialAc.g.cs | 24 ++++++++++++++++--- .../Quantities/ElectricPotentialDc.g.cs | 24 ++++++++++++++++--- .../Quantities/ElectricResistance.g.cs | 24 ++++++++++++++++--- .../Quantities/ElectricResistivity.g.cs | 24 ++++++++++++++++--- UnitsNet/GeneratedCode/Quantities/Energy.g.cs | 24 ++++++++++++++++--- .../GeneratedCode/Quantities/Entropy.g.cs | 24 ++++++++++++++++--- UnitsNet/GeneratedCode/Quantities/Flow.g.cs | 24 ++++++++++++++++--- UnitsNet/GeneratedCode/Quantities/Force.g.cs | 24 ++++++++++++++++--- .../Quantities/ForceChangeRate.g.cs | 24 ++++++++++++++++--- .../Quantities/ForcePerLength.g.cs | 24 ++++++++++++++++--- .../GeneratedCode/Quantities/Frequency.g.cs | 24 ++++++++++++++++--- .../GeneratedCode/Quantities/HeatFlux.g.cs | 24 ++++++++++++++++--- .../Quantities/HeatTransferCoefficient.g.cs | 24 ++++++++++++++++--- .../GeneratedCode/Quantities/Illuminance.g.cs | 24 ++++++++++++++++--- .../GeneratedCode/Quantities/Information.g.cs | 24 ++++++++++++++++--- .../GeneratedCode/Quantities/Irradiance.g.cs | 24 ++++++++++++++++--- .../GeneratedCode/Quantities/Irradiation.g.cs | 24 ++++++++++++++++--- .../Quantities/KinematicViscosity.g.cs | 24 ++++++++++++++++--- .../GeneratedCode/Quantities/LapseRate.g.cs | 24 ++++++++++++++++--- UnitsNet/GeneratedCode/Quantities/Length.g.cs | 24 ++++++++++++++++--- UnitsNet/GeneratedCode/Quantities/Level.g.cs | 24 ++++++++++++++++--- .../Quantities/LinearDensity.g.cs | 24 ++++++++++++++++--- .../Quantities/LuminousFlux.g.cs | 24 ++++++++++++++++--- .../Quantities/LuminousIntensity.g.cs | 24 ++++++++++++++++--- .../Quantities/MagneticField.g.cs | 24 ++++++++++++++++--- .../Quantities/MagneticFlux.g.cs | 24 ++++++++++++++++--- .../Quantities/Magnetization.g.cs | 24 ++++++++++++++++--- UnitsNet/GeneratedCode/Quantities/Mass.g.cs | 24 ++++++++++++++++--- .../GeneratedCode/Quantities/MassFlow.g.cs | 24 ++++++++++++++++--- .../GeneratedCode/Quantities/MassFlux.g.cs | 24 ++++++++++++++++--- .../Quantities/MassMomentOfInertia.g.cs | 24 ++++++++++++++++--- .../GeneratedCode/Quantities/MolarEnergy.g.cs | 24 ++++++++++++++++--- .../Quantities/MolarEntropy.g.cs | 24 ++++++++++++++++--- .../GeneratedCode/Quantities/MolarMass.g.cs | 24 ++++++++++++++++--- .../GeneratedCode/Quantities/Molarity.g.cs | 24 ++++++++++++++++--- .../Quantities/Permeability.g.cs | 24 ++++++++++++++++--- .../Quantities/Permittivity.g.cs | 24 ++++++++++++++++--- UnitsNet/GeneratedCode/Quantities/Power.g.cs | 24 ++++++++++++++++--- .../Quantities/PowerDensity.g.cs | 24 ++++++++++++++++--- .../GeneratedCode/Quantities/PowerRatio.g.cs | 24 ++++++++++++++++--- .../GeneratedCode/Quantities/Pressure.g.cs | 24 ++++++++++++++++--- .../Quantities/PressureChangeRate.g.cs | 24 ++++++++++++++++--- UnitsNet/GeneratedCode/Quantities/Ratio.g.cs | 24 ++++++++++++++++--- .../Quantities/ReactiveEnergy.g.cs | 24 ++++++++++++++++--- .../Quantities/ReactivePower.g.cs | 24 ++++++++++++++++--- .../Quantities/RotationalAcceleration.g.cs | 24 ++++++++++++++++--- .../Quantities/RotationalSpeed.g.cs | 24 ++++++++++++++++--- .../Quantities/RotationalStiffness.g.cs | 24 ++++++++++++++++--- .../RotationalStiffnessPerLength.g.cs | 24 ++++++++++++++++--- .../GeneratedCode/Quantities/SolidAngle.g.cs | 24 ++++++++++++++++--- .../Quantities/SpecificEnergy.g.cs | 24 ++++++++++++++++--- .../Quantities/SpecificEntropy.g.cs | 24 ++++++++++++++++--- .../Quantities/SpecificVolume.g.cs | 24 ++++++++++++++++--- .../Quantities/SpecificWeight.g.cs | 24 ++++++++++++++++--- UnitsNet/GeneratedCode/Quantities/Speed.g.cs | 24 ++++++++++++++++--- .../GeneratedCode/Quantities/Temperature.g.cs | 24 ++++++++++++++++--- .../Quantities/TemperatureChangeRate.g.cs | 24 ++++++++++++++++--- .../Quantities/TemperatureDelta.g.cs | 24 ++++++++++++++++--- .../Quantities/ThermalConductivity.g.cs | 24 ++++++++++++++++--- .../Quantities/ThermalResistance.g.cs | 24 ++++++++++++++++--- UnitsNet/GeneratedCode/Quantities/Torque.g.cs | 24 ++++++++++++++++--- .../GeneratedCode/Quantities/VitaminA.g.cs | 24 ++++++++++++++++--- UnitsNet/GeneratedCode/Quantities/Volume.g.cs | 24 ++++++++++++++++--- .../GeneratedCode/Quantities/VolumeFlow.g.cs | 24 ++++++++++++++++--- .../Include-GenerateQuantitySourceCode.ps1 | 24 ++++++++++++++++--- 91 files changed, 1911 insertions(+), 273 deletions(-) diff --git a/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs b/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs index 018e031c0a..e0d443c6f1 100644 --- a/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs @@ -796,12 +796,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs index 3a6e44cd9f..8d536984e2 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs @@ -829,12 +829,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs index d298fdeb29..e91e303073 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs @@ -507,12 +507,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/Angle.g.cs b/UnitsNet/GeneratedCode/Quantities/Angle.g.cs index 5bee5ff28e..75ed629c8d 100644 --- a/UnitsNet/GeneratedCode/Quantities/Angle.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Angle.g.cs @@ -829,12 +829,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs index c8a1e28f18..b881dd1132 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs @@ -466,12 +466,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs index bc18c617eb..50f9ab301b 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs @@ -499,12 +499,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/Area.g.cs b/UnitsNet/GeneratedCode/Quantities/Area.g.cs index e407e9d464..5f546f8367 100644 --- a/UnitsNet/GeneratedCode/Quantities/Area.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Area.g.cs @@ -796,12 +796,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs index 60a770b841..32bb34f2fa 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs @@ -400,12 +400,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs index cbd76bd43d..40fe769ba1 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs @@ -565,12 +565,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/BitRate.g.cs b/UnitsNet/GeneratedCode/Quantities/BitRate.g.cs index 82634f61e1..2334d7c6f3 100644 --- a/UnitsNet/GeneratedCode/Quantities/BitRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BitRate.g.cs @@ -1222,12 +1222,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs index a95acd5141..cff685db08 100644 --- a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs @@ -466,12 +466,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/Capacitance.g.cs b/UnitsNet/GeneratedCode/Quantities/Capacitance.g.cs index 6717bdafc2..08b5473c7a 100644 --- a/UnitsNet/GeneratedCode/Quantities/Capacitance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Capacitance.g.cs @@ -400,12 +400,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/Density.g.cs b/UnitsNet/GeneratedCode/Quantities/Density.g.cs index 5d5900b25b..f13e2a8425 100644 --- a/UnitsNet/GeneratedCode/Quantities/Density.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Density.g.cs @@ -1621,12 +1621,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/Duration.g.cs b/UnitsNet/GeneratedCode/Quantities/Duration.g.cs index 9d1e8908b2..9116e69c85 100644 --- a/UnitsNet/GeneratedCode/Quantities/Duration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Duration.g.cs @@ -765,12 +765,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs index 63251e41d9..2862166ccf 100644 --- a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs @@ -565,12 +565,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs index 00cf14fc7c..8e96da23a6 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs @@ -499,12 +499,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs index f7c5143029..2cd15a6ced 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs @@ -400,12 +400,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs index 4b85a038e9..a5d2a740ec 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs @@ -400,12 +400,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs index da7d5424da..3a1758ab6c 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs @@ -466,12 +466,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs index b7d97979c9..4cdf441035 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs @@ -400,12 +400,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs index a118c4eafb..a385b8140d 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs @@ -598,12 +598,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs index fa57148ba6..eb808ef196 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs @@ -400,12 +400,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs index d44a6984b1..e711abe5b1 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs @@ -400,12 +400,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs index a709775151..951cb134ae 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs @@ -400,12 +400,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs index b03bbf06de..e938af7508 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs @@ -400,12 +400,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs index d349173557..b1fa7142db 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs @@ -532,12 +532,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.g.cs index 0ca64d660f..2df98ad822 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.g.cs @@ -532,12 +532,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.g.cs index 87264e575d..3dac748270 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.g.cs @@ -532,12 +532,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs index b4fb6f2b70..4d4c00dafe 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs @@ -499,12 +499,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs index a29bd15504..3a31abd5ca 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs @@ -499,12 +499,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/Energy.g.cs b/UnitsNet/GeneratedCode/Quantities/Energy.g.cs index aacdd26042..2d740278ed 100644 --- a/UnitsNet/GeneratedCode/Quantities/Energy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Energy.g.cs @@ -1093,12 +1093,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs b/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs index 1038dc70bc..e5bab68c90 100644 --- a/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs @@ -598,12 +598,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/Flow.g.cs b/UnitsNet/GeneratedCode/Quantities/Flow.g.cs index 2825d880c1..883b487957 100644 --- a/UnitsNet/GeneratedCode/Quantities/Flow.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Flow.g.cs @@ -1177,12 +1177,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/Force.g.cs b/UnitsNet/GeneratedCode/Quantities/Force.g.cs index e852ff3d80..f4d13e1d27 100644 --- a/UnitsNet/GeneratedCode/Quantities/Force.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Force.g.cs @@ -697,12 +697,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs index 9088dc39fc..6b259b18ad 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs @@ -730,12 +730,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs index 07f5a7d9db..45beb5f714 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs @@ -664,12 +664,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs b/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs index 270488c2c5..56677b6ee9 100644 --- a/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs @@ -631,12 +631,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs index 984e75154f..efafdd93c5 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs @@ -895,12 +895,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs index df0b1fd2aa..2f60dfd7e4 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs @@ -433,12 +433,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs b/UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs index 3b4cf1e3fa..73c78c49e3 100644 --- a/UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs @@ -499,12 +499,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/Information.g.cs b/UnitsNet/GeneratedCode/Quantities/Information.g.cs index e3a5cad119..af3ce29d42 100644 --- a/UnitsNet/GeneratedCode/Quantities/Information.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Information.g.cs @@ -1222,12 +1222,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs index e69b62c0a8..e872d18928 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs @@ -433,12 +433,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs index 9bbc40e903..e8d62a5491 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs @@ -466,12 +466,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs index d588f0be50..84a802fdf8 100644 --- a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs @@ -631,12 +631,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/LapseRate.g.cs b/UnitsNet/GeneratedCode/Quantities/LapseRate.g.cs index d4760e8df3..c0f0549098 100644 --- a/UnitsNet/GeneratedCode/Quantities/LapseRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LapseRate.g.cs @@ -400,12 +400,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/Length.g.cs b/UnitsNet/GeneratedCode/Quantities/Length.g.cs index 8856f8959a..9ef2f5bf64 100644 --- a/UnitsNet/GeneratedCode/Quantities/Length.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Length.g.cs @@ -1093,12 +1093,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/Level.g.cs b/UnitsNet/GeneratedCode/Quantities/Level.g.cs index 71166719c4..4b1e254eb6 100644 --- a/UnitsNet/GeneratedCode/Quantities/Level.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Level.g.cs @@ -441,12 +441,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs index 182ca614ed..b476204fad 100644 --- a/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs @@ -466,12 +466,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.g.cs index 34bc5e2dc0..9d16e80176 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.g.cs @@ -400,12 +400,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs index e5895e7377..0ab339b2a8 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs @@ -400,12 +400,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticField.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticField.g.cs index 82aa5918b4..ddf54498fe 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticField.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticField.g.cs @@ -400,12 +400,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.g.cs index 6f2ec5434e..5fb30a65d7 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.g.cs @@ -400,12 +400,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/Magnetization.g.cs b/UnitsNet/GeneratedCode/Quantities/Magnetization.g.cs index a4d948f661..a51f0591a5 100644 --- a/UnitsNet/GeneratedCode/Quantities/Magnetization.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Magnetization.g.cs @@ -400,12 +400,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/Mass.g.cs b/UnitsNet/GeneratedCode/Quantities/Mass.g.cs index bc78990985..9c5bc93b28 100644 --- a/UnitsNet/GeneratedCode/Quantities/Mass.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Mass.g.cs @@ -1060,12 +1060,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs index 2f32645118..31f7cabb5c 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs @@ -862,12 +862,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs index 5ab3529be9..a23ef7c722 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs @@ -433,12 +433,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.g.cs b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.g.cs index 6ebc84c9b3..57c641cb76 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.g.cs @@ -1225,12 +1225,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.g.cs index 9d9026d787..2e8e58fdf9 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.g.cs @@ -466,12 +466,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.g.cs index 9e6e462f53..e9645e71cd 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.g.cs @@ -466,12 +466,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs index 3eda8ae1a2..6c63d14786 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs @@ -763,12 +763,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs b/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs index 1a4837c7b5..9d19bae72b 100644 --- a/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs @@ -631,12 +631,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/Permeability.g.cs b/UnitsNet/GeneratedCode/Quantities/Permeability.g.cs index e89835ef90..6f909d9a96 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permeability.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permeability.g.cs @@ -400,12 +400,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/Permittivity.g.cs b/UnitsNet/GeneratedCode/Quantities/Permittivity.g.cs index 40cbefac2b..37286b0b26 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permittivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permittivity.g.cs @@ -400,12 +400,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/Power.g.cs b/UnitsNet/GeneratedCode/Quantities/Power.g.cs index abde713c71..71c8f0568a 100644 --- a/UnitsNet/GeneratedCode/Quantities/Power.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Power.g.cs @@ -1024,12 +1024,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs index 3a53aa523e..114fece900 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs @@ -1819,12 +1819,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/PowerRatio.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerRatio.g.cs index d5f84f1f63..a3fa8e0d3e 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerRatio.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerRatio.g.cs @@ -441,12 +441,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs b/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs index ef0e7b36d4..c4e18a5bb1 100644 --- a/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs @@ -1622,12 +1622,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs index ab6987d46c..f5248f3ded 100644 --- a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs @@ -499,12 +499,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs b/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs index 9bf00139a2..de145ea0ba 100644 --- a/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs @@ -565,12 +565,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.g.cs index 33e0a48556..a7d0022fbf 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.g.cs @@ -466,12 +466,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/ReactivePower.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactivePower.g.cs index c28125ce7c..6f18f7d63d 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactivePower.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactivePower.g.cs @@ -499,12 +499,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.g.cs index 67b5a64fb1..007ab9e935 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.g.cs @@ -466,12 +466,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs index bbb7baec0c..4d589abc35 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs @@ -796,12 +796,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs index 86d1956a5d..7cef552e17 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs @@ -466,12 +466,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs index 8747c8f90e..0283c1fd3f 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs @@ -466,12 +466,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/SolidAngle.g.cs b/UnitsNet/GeneratedCode/Quantities/SolidAngle.g.cs index d6502071e2..5343b0f4f9 100644 --- a/UnitsNet/GeneratedCode/Quantities/SolidAngle.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SolidAngle.g.cs @@ -400,12 +400,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs index f5e95d55e7..42c4d112e4 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs @@ -631,12 +631,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs index eb74dc3cdb..608fa7de2f 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs @@ -631,12 +631,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs index 51945999a8..953a66a754 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs @@ -400,12 +400,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs index 3b7f9ee311..54592cd7d3 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs @@ -928,12 +928,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/Speed.g.cs b/UnitsNet/GeneratedCode/Quantities/Speed.g.cs index c446d89348..5cc33af8b2 100644 --- a/UnitsNet/GeneratedCode/Quantities/Speed.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Speed.g.cs @@ -1423,12 +1423,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/Temperature.g.cs b/UnitsNet/GeneratedCode/Quantities/Temperature.g.cs index 294f4ca95f..611e7f6c5e 100644 --- a/UnitsNet/GeneratedCode/Quantities/Temperature.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Temperature.g.cs @@ -589,12 +589,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.g.cs index 0b59fdebb5..eed44584d0 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.g.cs @@ -697,12 +697,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs index 10f72e638b..f47efa21d3 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs @@ -903,12 +903,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.g.cs index 4884543556..0a82958c11 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.g.cs @@ -433,12 +433,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.g.cs index 146c95fa35..1d97ef1c4e 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.g.cs @@ -532,12 +532,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/Torque.g.cs b/UnitsNet/GeneratedCode/Quantities/Torque.g.cs index 7beb4652fc..87afd97244 100644 --- a/UnitsNet/GeneratedCode/Quantities/Torque.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Torque.g.cs @@ -1060,12 +1060,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/VitaminA.g.cs b/UnitsNet/GeneratedCode/Quantities/VitaminA.g.cs index 5fb392324b..9685f23bbe 100644 --- a/UnitsNet/GeneratedCode/Quantities/VitaminA.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VitaminA.g.cs @@ -400,12 +400,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/Volume.g.cs b/UnitsNet/GeneratedCode/Quantities/Volume.g.cs index 197614041a..24e7b73938 100644 --- a/UnitsNet/GeneratedCode/Quantities/Volume.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Volume.g.cs @@ -1821,12 +1821,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs index 29de21e60e..44dcfe5b44 100644 --- a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs @@ -1159,12 +1159,30 @@ public override bool Equals(object obj) /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature diff --git a/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 b/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 index b23c00b87c..9433b8171b 100644 --- a/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 +++ b/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 @@ -450,12 +450,30 @@ namespace UnitsNet /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a percentage of this quantity's value. For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of this quantity's value to be considered equal. + /// as a percentage of this quantity's value. will be converted into + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's value to be considered equal. + /// + /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between this quantity's value and - /// as a fixed number. + /// as a fixed number in this quantity's unit. will be converted into + /// this quantity's unit for comparison. + /// + /// In this example, the two quantities will be equal if the value of b is within 0.01 of a (0.01m or 1cm). + /// + /// var a = Length.FromMeters(2.0); + /// var b = Length.FromInches(50.0); + /// a.Equals(b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// Note that it is advised against specifying zero difference, due to the nature From 62e3424de720836c5aaf4762f5f3ca3883e96c96 Mon Sep 17 00:00:00 2001 From: Tristan Milnthorp Date: Tue, 26 Jun 2018 09:46:09 -0400 Subject: [PATCH 16/19] Updating documentation for clarity --- UnitsNet/Comparison.cs | 44 +++++++++++++++---- .../Quantities/Acceleration.g.cs | 8 ++-- .../Quantities/AmountOfSubstance.g.cs | 8 ++-- .../Quantities/AmplitudeRatio.g.cs | 8 ++-- UnitsNet/GeneratedCode/Quantities/Angle.g.cs | 8 ++-- .../Quantities/ApparentEnergy.g.cs | 8 ++-- .../Quantities/ApparentPower.g.cs | 8 ++-- UnitsNet/GeneratedCode/Quantities/Area.g.cs | 8 ++-- .../GeneratedCode/Quantities/AreaDensity.g.cs | 8 ++-- .../Quantities/AreaMomentOfInertia.g.cs | 8 ++-- .../GeneratedCode/Quantities/BitRate.g.cs | 8 ++-- .../BrakeSpecificFuelConsumption.g.cs | 8 ++-- .../GeneratedCode/Quantities/Capacitance.g.cs | 8 ++-- .../GeneratedCode/Quantities/Density.g.cs | 8 ++-- .../GeneratedCode/Quantities/Duration.g.cs | 8 ++-- .../Quantities/DynamicViscosity.g.cs | 8 ++-- .../Quantities/ElectricAdmittance.g.cs | 8 ++-- .../Quantities/ElectricCharge.g.cs | 8 ++-- .../Quantities/ElectricChargeDensity.g.cs | 8 ++-- .../Quantities/ElectricConductance.g.cs | 8 ++-- .../Quantities/ElectricConductivity.g.cs | 8 ++-- .../Quantities/ElectricCurrent.g.cs | 8 ++-- .../Quantities/ElectricCurrentDensity.g.cs | 8 ++-- .../Quantities/ElectricCurrentGradient.g.cs | 8 ++-- .../Quantities/ElectricField.g.cs | 8 ++-- .../Quantities/ElectricInductance.g.cs | 8 ++-- .../Quantities/ElectricPotential.g.cs | 8 ++-- .../Quantities/ElectricPotentialAc.g.cs | 8 ++-- .../Quantities/ElectricPotentialDc.g.cs | 8 ++-- .../Quantities/ElectricResistance.g.cs | 8 ++-- .../Quantities/ElectricResistivity.g.cs | 8 ++-- UnitsNet/GeneratedCode/Quantities/Energy.g.cs | 8 ++-- .../GeneratedCode/Quantities/Entropy.g.cs | 8 ++-- UnitsNet/GeneratedCode/Quantities/Flow.g.cs | 8 ++-- UnitsNet/GeneratedCode/Quantities/Force.g.cs | 8 ++-- .../Quantities/ForceChangeRate.g.cs | 8 ++-- .../Quantities/ForcePerLength.g.cs | 8 ++-- .../GeneratedCode/Quantities/Frequency.g.cs | 8 ++-- .../GeneratedCode/Quantities/HeatFlux.g.cs | 8 ++-- .../Quantities/HeatTransferCoefficient.g.cs | 8 ++-- .../GeneratedCode/Quantities/Illuminance.g.cs | 8 ++-- .../GeneratedCode/Quantities/Information.g.cs | 8 ++-- .../GeneratedCode/Quantities/Irradiance.g.cs | 8 ++-- .../GeneratedCode/Quantities/Irradiation.g.cs | 8 ++-- .../Quantities/KinematicViscosity.g.cs | 8 ++-- .../GeneratedCode/Quantities/LapseRate.g.cs | 8 ++-- UnitsNet/GeneratedCode/Quantities/Length.g.cs | 8 ++-- UnitsNet/GeneratedCode/Quantities/Level.g.cs | 8 ++-- .../Quantities/LinearDensity.g.cs | 8 ++-- .../Quantities/LuminousFlux.g.cs | 8 ++-- .../Quantities/LuminousIntensity.g.cs | 8 ++-- .../Quantities/MagneticField.g.cs | 8 ++-- .../Quantities/MagneticFlux.g.cs | 8 ++-- .../Quantities/Magnetization.g.cs | 8 ++-- UnitsNet/GeneratedCode/Quantities/Mass.g.cs | 8 ++-- .../GeneratedCode/Quantities/MassFlow.g.cs | 8 ++-- .../GeneratedCode/Quantities/MassFlux.g.cs | 8 ++-- .../Quantities/MassMomentOfInertia.g.cs | 8 ++-- .../GeneratedCode/Quantities/MolarEnergy.g.cs | 8 ++-- .../Quantities/MolarEntropy.g.cs | 8 ++-- .../GeneratedCode/Quantities/MolarMass.g.cs | 8 ++-- .../GeneratedCode/Quantities/Molarity.g.cs | 8 ++-- .../Quantities/Permeability.g.cs | 8 ++-- .../Quantities/Permittivity.g.cs | 8 ++-- UnitsNet/GeneratedCode/Quantities/Power.g.cs | 8 ++-- .../Quantities/PowerDensity.g.cs | 8 ++-- .../GeneratedCode/Quantities/PowerRatio.g.cs | 8 ++-- .../GeneratedCode/Quantities/Pressure.g.cs | 8 ++-- .../Quantities/PressureChangeRate.g.cs | 8 ++-- UnitsNet/GeneratedCode/Quantities/Ratio.g.cs | 8 ++-- .../Quantities/ReactiveEnergy.g.cs | 8 ++-- .../Quantities/ReactivePower.g.cs | 8 ++-- .../Quantities/RotationalAcceleration.g.cs | 8 ++-- .../Quantities/RotationalSpeed.g.cs | 8 ++-- .../Quantities/RotationalStiffness.g.cs | 8 ++-- .../RotationalStiffnessPerLength.g.cs | 8 ++-- .../GeneratedCode/Quantities/SolidAngle.g.cs | 8 ++-- .../Quantities/SpecificEnergy.g.cs | 8 ++-- .../Quantities/SpecificEntropy.g.cs | 8 ++-- .../Quantities/SpecificVolume.g.cs | 8 ++-- .../Quantities/SpecificWeight.g.cs | 8 ++-- UnitsNet/GeneratedCode/Quantities/Speed.g.cs | 8 ++-- .../GeneratedCode/Quantities/Temperature.g.cs | 8 ++-- .../Quantities/TemperatureChangeRate.g.cs | 8 ++-- .../Quantities/TemperatureDelta.g.cs | 8 ++-- .../Quantities/ThermalConductivity.g.cs | 8 ++-- .../Quantities/ThermalResistance.g.cs | 8 ++-- UnitsNet/GeneratedCode/Quantities/Torque.g.cs | 8 ++-- .../GeneratedCode/Quantities/VitaminA.g.cs | 8 ++-- UnitsNet/GeneratedCode/Quantities/Volume.g.cs | 8 ++-- .../GeneratedCode/Quantities/VolumeFlow.g.cs | 8 ++-- .../Include-GenerateQuantitySourceCode.ps1 | 8 ++-- 92 files changed, 400 insertions(+), 372 deletions(-) diff --git a/UnitsNet/Comparison.cs b/UnitsNet/Comparison.cs index c945024e8c..310c94150a 100644 --- a/UnitsNet/Comparison.cs +++ b/UnitsNet/Comparison.cs @@ -31,17 +31,29 @@ public static class Comparison /// /// /// Relative tolerance is defined as the maximum allowable absolute difference between and - /// as a percentage of . For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of to be considered equal. + /// as a percentage of . A relative tolerance of 0.01 means the + /// absolute difference of and must be within +/- 1%. + /// + /// In this example, the two values will be equal if the value of b is within +/- 1% of a. + /// + /// Equals(a, b, 0.01, ComparisonType.Relative); + /// + /// /// /// /// Absolute tolerance is defined as the maximum allowable absolute difference between and /// as a fixed number. + /// + /// In this example, the two values will be equal if abs( - ) <= 0.01 + /// + /// Equals(a, b, 0.01, ComparisonType.Absolute); + /// + /// /// /// /// The reference value. If using relative tolerance, it is the value which the relative tolerance will be calculated against. /// The value to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// Whether the tolerance is absolute or relative. /// public static bool Equals(double referenceValue, double otherValue, double tolerance, ComparisonType comparisonType) @@ -62,13 +74,21 @@ public static bool Equals(double referenceValue, double otherValue, double toler /// /// Checks if two values are equal with a given relative tolerance. - /// Relative tolerance is defined as the maximum allowable difference between and - /// as a percentage of . For example, a relative tolerance - /// of 0.01 means the difference must be within +/- 1% of to be considered equal. + /// + /// Relative tolerance is defined as the maximum allowable absolute difference between and + /// as a percentage of . A relative tolerance of 0.01 means the + /// absolute difference of and must be within +/- 1%. + /// + /// In this example, the two values will be equal if the value of b is within +/- 1% of a. + /// + /// EqualsRelative(a, b, 0.01); + /// + /// + /// /// /// The reference value which the tolerance will be calculated against. /// The value to compare to. - /// The relative tolerance. Must be greater than 0. + /// The relative tolerance. Must be greater than or equal to 0. /// True if the two values are equal within the given relative tolerance, otherwise false. public static bool EqualsRelative(double referenceValue, double otherValue, double tolerance) { @@ -81,12 +101,20 @@ public static bool EqualsRelative(double referenceValue, double otherValue, doub /// /// Checks if two values are equal with a given absolute tolerance. + /// /// Absolute tolerance is defined as the maximum allowable absolute difference between and /// as a fixed number. + /// + /// In this example, the two values will be equal if abs( - ) <= 0.01 + /// + /// Equals(a, b, 0.01, ComparisonType.Absolute); + /// + /// + /// /// /// The first value. /// The second value. - /// The absolute tolerance. This is the maxinum allowable absolute difference between the two values. Must be greater than 0. + /// The absolute tolerance. Must be greater than or equal to 0. /// True if the two values are equal within the given absolute tolerance, otherwise false. public static bool EqualsAbsolute(double value1, double value2, double tolerance) { diff --git a/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs b/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs index e0d443c6f1..1ac631fa9d 100644 --- a/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs @@ -797,7 +797,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -827,13 +827,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Acceleration other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs index 8d536984e2..b63522121d 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs @@ -830,7 +830,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -860,13 +860,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(AmountOfSubstance other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs index e91e303073..ac9ba3c543 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs @@ -508,7 +508,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -538,13 +538,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(AmplitudeRatio other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/Angle.g.cs b/UnitsNet/GeneratedCode/Quantities/Angle.g.cs index 75ed629c8d..21b7659d27 100644 --- a/UnitsNet/GeneratedCode/Quantities/Angle.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Angle.g.cs @@ -830,7 +830,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -860,13 +860,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Angle other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs index b881dd1132..a647099c0d 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs @@ -467,7 +467,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -497,13 +497,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ApparentEnergy other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs index 50f9ab301b..85b91d190b 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs @@ -500,7 +500,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -530,13 +530,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ApparentPower other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/Area.g.cs b/UnitsNet/GeneratedCode/Quantities/Area.g.cs index 5f546f8367..e0b8db9165 100644 --- a/UnitsNet/GeneratedCode/Quantities/Area.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Area.g.cs @@ -797,7 +797,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -827,13 +827,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Area other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs index 32bb34f2fa..8e29e81280 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs @@ -401,7 +401,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -431,13 +431,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(AreaDensity other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs index 40fe769ba1..4c827cba29 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs @@ -566,7 +566,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -596,13 +596,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(AreaMomentOfInertia other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/BitRate.g.cs b/UnitsNet/GeneratedCode/Quantities/BitRate.g.cs index 2334d7c6f3..c5248bb3d5 100644 --- a/UnitsNet/GeneratedCode/Quantities/BitRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BitRate.g.cs @@ -1223,7 +1223,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -1253,13 +1253,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(BitRate other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs index cff685db08..a5840859f6 100644 --- a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs @@ -467,7 +467,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -497,13 +497,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(BrakeSpecificFuelConsumption other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/Capacitance.g.cs b/UnitsNet/GeneratedCode/Quantities/Capacitance.g.cs index 08b5473c7a..d820a0b0eb 100644 --- a/UnitsNet/GeneratedCode/Quantities/Capacitance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Capacitance.g.cs @@ -401,7 +401,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -431,13 +431,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Capacitance other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/Density.g.cs b/UnitsNet/GeneratedCode/Quantities/Density.g.cs index f13e2a8425..f14f2a42a7 100644 --- a/UnitsNet/GeneratedCode/Quantities/Density.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Density.g.cs @@ -1622,7 +1622,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -1652,13 +1652,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Density other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/Duration.g.cs b/UnitsNet/GeneratedCode/Quantities/Duration.g.cs index 9116e69c85..2a3ccaadf2 100644 --- a/UnitsNet/GeneratedCode/Quantities/Duration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Duration.g.cs @@ -766,7 +766,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -796,13 +796,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Duration other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs index 2862166ccf..e1bdb9b86d 100644 --- a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs @@ -566,7 +566,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -596,13 +596,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(DynamicViscosity other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs index 8e96da23a6..ec7a0bd239 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs @@ -500,7 +500,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -530,13 +530,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ElectricAdmittance other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs index 2cd15a6ced..2e65e27a2c 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs @@ -401,7 +401,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -431,13 +431,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ElectricCharge other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs index a5d2a740ec..88edcfbb13 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs @@ -401,7 +401,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -431,13 +431,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ElectricChargeDensity other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs index 3a1758ab6c..afcb0ba0e3 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs @@ -467,7 +467,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -497,13 +497,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ElectricConductance other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs index 4cdf441035..ff71f2acec 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs @@ -401,7 +401,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -431,13 +431,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ElectricConductivity other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs index a385b8140d..cb2ea51b91 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs @@ -599,7 +599,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -629,13 +629,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ElectricCurrent other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs index eb808ef196..3671a23d7b 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs @@ -401,7 +401,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -431,13 +431,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ElectricCurrentDensity other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs index e711abe5b1..a37c5bfcb3 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs @@ -401,7 +401,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -431,13 +431,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ElectricCurrentGradient other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs index 951cb134ae..c2aa8d89a8 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs @@ -401,7 +401,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -431,13 +431,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ElectricField other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs index e938af7508..695a33f5cd 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs @@ -401,7 +401,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -431,13 +431,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ElectricInductance other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs index b1fa7142db..364d5a0175 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs @@ -533,7 +533,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -563,13 +563,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ElectricPotential other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.g.cs index 2df98ad822..c082eb396a 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.g.cs @@ -533,7 +533,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -563,13 +563,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ElectricPotentialAc other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.g.cs index 3dac748270..cbd286bbcd 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.g.cs @@ -533,7 +533,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -563,13 +563,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ElectricPotentialDc other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs index 4d4c00dafe..7af07329c3 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs @@ -500,7 +500,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -530,13 +530,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ElectricResistance other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs index 3a31abd5ca..b5ed6dc0be 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs @@ -500,7 +500,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -530,13 +530,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ElectricResistivity other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/Energy.g.cs b/UnitsNet/GeneratedCode/Quantities/Energy.g.cs index 2d740278ed..afb21b38c9 100644 --- a/UnitsNet/GeneratedCode/Quantities/Energy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Energy.g.cs @@ -1094,7 +1094,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -1124,13 +1124,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Energy other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs b/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs index e5bab68c90..c1fe08ecb6 100644 --- a/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs @@ -599,7 +599,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -629,13 +629,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Entropy other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/Flow.g.cs b/UnitsNet/GeneratedCode/Quantities/Flow.g.cs index 883b487957..24905442eb 100644 --- a/UnitsNet/GeneratedCode/Quantities/Flow.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Flow.g.cs @@ -1178,7 +1178,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -1208,13 +1208,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Flow other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/Force.g.cs b/UnitsNet/GeneratedCode/Quantities/Force.g.cs index f4d13e1d27..25f12a30dd 100644 --- a/UnitsNet/GeneratedCode/Quantities/Force.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Force.g.cs @@ -698,7 +698,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -728,13 +728,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Force other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs index 6b259b18ad..ff0f1139fc 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs @@ -731,7 +731,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -761,13 +761,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ForceChangeRate other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs index 45beb5f714..9b4556c76a 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs @@ -665,7 +665,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -695,13 +695,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ForcePerLength other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs b/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs index 56677b6ee9..63b22a0182 100644 --- a/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs @@ -632,7 +632,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -662,13 +662,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Frequency other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs index efafdd93c5..3e3de5cf0d 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs @@ -896,7 +896,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -926,13 +926,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(HeatFlux other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs index 2f60dfd7e4..11bb29e292 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs @@ -434,7 +434,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -464,13 +464,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(HeatTransferCoefficient other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs b/UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs index 73c78c49e3..f1f3d16a34 100644 --- a/UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs @@ -500,7 +500,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -530,13 +530,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Illuminance other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/Information.g.cs b/UnitsNet/GeneratedCode/Quantities/Information.g.cs index af3ce29d42..3ad4a76c2e 100644 --- a/UnitsNet/GeneratedCode/Quantities/Information.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Information.g.cs @@ -1223,7 +1223,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -1253,13 +1253,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Information other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs index e872d18928..5a552d1219 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs @@ -434,7 +434,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -464,13 +464,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Irradiance other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs index e8d62a5491..ca64535e94 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs @@ -467,7 +467,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -497,13 +497,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Irradiation other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs index 84a802fdf8..0194f2bf4f 100644 --- a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs @@ -632,7 +632,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -662,13 +662,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(KinematicViscosity other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/LapseRate.g.cs b/UnitsNet/GeneratedCode/Quantities/LapseRate.g.cs index c0f0549098..d609d4724f 100644 --- a/UnitsNet/GeneratedCode/Quantities/LapseRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LapseRate.g.cs @@ -401,7 +401,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -431,13 +431,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(LapseRate other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/Length.g.cs b/UnitsNet/GeneratedCode/Quantities/Length.g.cs index 9ef2f5bf64..a2565600c9 100644 --- a/UnitsNet/GeneratedCode/Quantities/Length.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Length.g.cs @@ -1094,7 +1094,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -1124,13 +1124,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Length other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/Level.g.cs b/UnitsNet/GeneratedCode/Quantities/Level.g.cs index 4b1e254eb6..2996c6b667 100644 --- a/UnitsNet/GeneratedCode/Quantities/Level.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Level.g.cs @@ -442,7 +442,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -472,13 +472,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Level other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs index b476204fad..914886e7b2 100644 --- a/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs @@ -467,7 +467,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -497,13 +497,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(LinearDensity other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.g.cs index 9d16e80176..b4d7a9863d 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.g.cs @@ -401,7 +401,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -431,13 +431,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(LuminousFlux other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs index 0ab339b2a8..486fbf379b 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs @@ -401,7 +401,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -431,13 +431,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(LuminousIntensity other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticField.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticField.g.cs index ddf54498fe..5dbab4d363 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticField.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticField.g.cs @@ -401,7 +401,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -431,13 +431,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(MagneticField other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.g.cs index 5fb30a65d7..cf729ca245 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.g.cs @@ -401,7 +401,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -431,13 +431,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(MagneticFlux other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/Magnetization.g.cs b/UnitsNet/GeneratedCode/Quantities/Magnetization.g.cs index a51f0591a5..dc23a56ae0 100644 --- a/UnitsNet/GeneratedCode/Quantities/Magnetization.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Magnetization.g.cs @@ -401,7 +401,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -431,13 +431,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Magnetization other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/Mass.g.cs b/UnitsNet/GeneratedCode/Quantities/Mass.g.cs index 9c5bc93b28..0470164ed1 100644 --- a/UnitsNet/GeneratedCode/Quantities/Mass.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Mass.g.cs @@ -1061,7 +1061,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -1091,13 +1091,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Mass other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs index 31f7cabb5c..8b5d0f96f8 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs @@ -863,7 +863,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -893,13 +893,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(MassFlow other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs index a23ef7c722..f2eef98e11 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs @@ -434,7 +434,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -464,13 +464,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(MassFlux other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.g.cs b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.g.cs index 57c641cb76..b295a1f180 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.g.cs @@ -1226,7 +1226,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -1256,13 +1256,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(MassMomentOfInertia other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.g.cs index 2e8e58fdf9..ebc5f35ec9 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.g.cs @@ -467,7 +467,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -497,13 +497,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(MolarEnergy other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.g.cs index e9645e71cd..70e8aaf43c 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.g.cs @@ -467,7 +467,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -497,13 +497,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(MolarEntropy other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs index 6c63d14786..7e79239dca 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs @@ -764,7 +764,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -794,13 +794,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(MolarMass other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs b/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs index 9d19bae72b..a67b08ce59 100644 --- a/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs @@ -632,7 +632,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -662,13 +662,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Molarity other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/Permeability.g.cs b/UnitsNet/GeneratedCode/Quantities/Permeability.g.cs index 6f909d9a96..38cba4794d 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permeability.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permeability.g.cs @@ -401,7 +401,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -431,13 +431,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Permeability other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/Permittivity.g.cs b/UnitsNet/GeneratedCode/Quantities/Permittivity.g.cs index 37286b0b26..eab90cb4ec 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permittivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permittivity.g.cs @@ -401,7 +401,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -431,13 +431,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Permittivity other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/Power.g.cs b/UnitsNet/GeneratedCode/Quantities/Power.g.cs index 71c8f0568a..ae49a2c7c7 100644 --- a/UnitsNet/GeneratedCode/Quantities/Power.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Power.g.cs @@ -1025,7 +1025,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -1055,13 +1055,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Power other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs index 114fece900..5f39ca37cc 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs @@ -1820,7 +1820,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -1850,13 +1850,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(PowerDensity other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/PowerRatio.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerRatio.g.cs index a3fa8e0d3e..c1a2a6cb9c 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerRatio.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerRatio.g.cs @@ -442,7 +442,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -472,13 +472,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(PowerRatio other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs b/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs index c4e18a5bb1..f0199f2235 100644 --- a/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs @@ -1623,7 +1623,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -1653,13 +1653,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Pressure other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs index f5248f3ded..e9dccaa48b 100644 --- a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs @@ -500,7 +500,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -530,13 +530,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(PressureChangeRate other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs b/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs index de145ea0ba..23eedb139e 100644 --- a/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs @@ -566,7 +566,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -596,13 +596,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Ratio other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.g.cs index a7d0022fbf..766b040dc7 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.g.cs @@ -467,7 +467,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -497,13 +497,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ReactiveEnergy other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/ReactivePower.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactivePower.g.cs index 6f18f7d63d..12a744cdad 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactivePower.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactivePower.g.cs @@ -500,7 +500,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -530,13 +530,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ReactivePower other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.g.cs index 007ab9e935..58229e3eb9 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.g.cs @@ -467,7 +467,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -497,13 +497,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(RotationalAcceleration other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs index 4d589abc35..324b127508 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs @@ -797,7 +797,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -827,13 +827,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(RotationalSpeed other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs index 7cef552e17..6883a72d66 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs @@ -467,7 +467,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -497,13 +497,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(RotationalStiffness other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs index 0283c1fd3f..6955103855 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs @@ -467,7 +467,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -497,13 +497,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(RotationalStiffnessPerLength other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/SolidAngle.g.cs b/UnitsNet/GeneratedCode/Quantities/SolidAngle.g.cs index 5343b0f4f9..276e3a9498 100644 --- a/UnitsNet/GeneratedCode/Quantities/SolidAngle.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SolidAngle.g.cs @@ -401,7 +401,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -431,13 +431,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(SolidAngle other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs index 42c4d112e4..545955ff59 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs @@ -632,7 +632,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -662,13 +662,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(SpecificEnergy other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs index 608fa7de2f..6d25836a7c 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs @@ -632,7 +632,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -662,13 +662,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(SpecificEntropy other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs index 953a66a754..43654e94dc 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs @@ -401,7 +401,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -431,13 +431,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(SpecificVolume other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs index 54592cd7d3..126fcfd024 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs @@ -929,7 +929,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -959,13 +959,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(SpecificWeight other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/Speed.g.cs b/UnitsNet/GeneratedCode/Quantities/Speed.g.cs index 5cc33af8b2..de1d078955 100644 --- a/UnitsNet/GeneratedCode/Quantities/Speed.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Speed.g.cs @@ -1424,7 +1424,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -1454,13 +1454,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Speed other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/Temperature.g.cs b/UnitsNet/GeneratedCode/Quantities/Temperature.g.cs index 611e7f6c5e..e901ad3acf 100644 --- a/UnitsNet/GeneratedCode/Quantities/Temperature.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Temperature.g.cs @@ -590,7 +590,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -620,13 +620,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Temperature other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.g.cs index eed44584d0..8fb212380f 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.g.cs @@ -698,7 +698,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -728,13 +728,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(TemperatureChangeRate other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs index f47efa21d3..2b27086367 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs @@ -904,7 +904,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -934,13 +934,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(TemperatureDelta other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.g.cs index 0a82958c11..34a1a31f5b 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.g.cs @@ -434,7 +434,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -464,13 +464,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ThermalConductivity other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.g.cs index 1d97ef1c4e..742c2b1eb6 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.g.cs @@ -533,7 +533,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -563,13 +563,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(ThermalResistance other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/Torque.g.cs b/UnitsNet/GeneratedCode/Quantities/Torque.g.cs index 87afd97244..6b583bd9f2 100644 --- a/UnitsNet/GeneratedCode/Quantities/Torque.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Torque.g.cs @@ -1061,7 +1061,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -1091,13 +1091,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Torque other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/VitaminA.g.cs b/UnitsNet/GeneratedCode/Quantities/VitaminA.g.cs index 9685f23bbe..c1fc827e7a 100644 --- a/UnitsNet/GeneratedCode/Quantities/VitaminA.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VitaminA.g.cs @@ -401,7 +401,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -431,13 +431,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(VitaminA other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/Volume.g.cs b/UnitsNet/GeneratedCode/Quantities/Volume.g.cs index 24e7b73938..bf3475ef77 100644 --- a/UnitsNet/GeneratedCode/Quantities/Volume.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Volume.g.cs @@ -1822,7 +1822,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -1852,13 +1852,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(Volume other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs index 44dcfe5b44..c35cf5b545 100644 --- a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs @@ -1160,7 +1160,7 @@ public override bool Equals(object obj) /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -1190,13 +1190,13 @@ public override bool Equals(object obj) /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals(VolumeFlow other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); diff --git a/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 b/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 index 9433b8171b..aa7c68f6fa 100644 --- a/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 +++ b/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 @@ -451,7 +451,7 @@ namespace UnitsNet /// /// Relative tolerance is defined as the maximum allowable absolute difference between this quantity's value and /// as a percentage of this quantity's value. will be converted into - /// this quantity's unit for comparison. A relative tolerance of 0.01 means the difference must be within +/- 1% of + /// this quantity's unit for comparison. A relative tolerance of 0.01 means the absolute difference must be within +/- 1% of /// this quantity's value to be considered equal. /// /// In this example, the two quantities will be equal if the value of b is within +/- 1% of a (0.02m or 2cm). @@ -481,13 +481,13 @@ namespace UnitsNet /// /// /// The other quantity to compare to. - /// The absolute or relative tolerance value. Must be greater than 0. + /// The absolute or relative tolerance value. Must be greater than or equal to 0. /// The comparison type: either relative or absolute. - /// True if the difference between the two values is not greater than the specified relative or absolute tolerance. + /// True if the absolute difference between the two values is not greater than the specified relative or absolute tolerance. public bool Equals($quantityName other, double tolerance, ComparisonType comparisonType) { if(tolerance < 0) - throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0"); + throw new ArgumentOutOfRangeException("tolerance", "Tolerance must be greater than or equal to 0."); double thisValue = (double)this.Value; double otherValueInThisUnits = other.As(this.Unit); From 2071848146abea947f264ede99cc5f09cae45b18 Mon Sep 17 00:00:00 2001 From: Tristan Milnthorp Date: Tue, 26 Jun 2018 09:46:53 -0400 Subject: [PATCH 17/19] Fix for compiler warning --- UnitsNet.Tests/QuantityTests.ToString.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UnitsNet.Tests/QuantityTests.ToString.cs b/UnitsNet.Tests/QuantityTests.ToString.cs index edf97428b9..bab0e87a31 100644 --- a/UnitsNet.Tests/QuantityTests.ToString.cs +++ b/UnitsNet.Tests/QuantityTests.ToString.cs @@ -28,7 +28,7 @@ namespace UnitsNet.Tests [Collection(nameof(UnitSystemFixture))] public partial class QuantityTests { - public class ToString + public class ToStringTests { [Fact] public void CreatedByDefaultCtor_ReturnsValueInBaseUnit() From 760f17f966817bef587614f0d0d2cface85921ee Mon Sep 17 00:00:00 2001 From: Tristan Milnthorp Date: Tue, 26 Jun 2018 10:09:39 -0400 Subject: [PATCH 18/19] Obsolete Equals($quantityName other, $quantityName maxError). Fix Equals methods that were scaling to base units when unnecessary. Whitespace fixes. --- .../Quantities/Acceleration.g.cs | 26 ++++++++--------- .../Quantities/AmountOfSubstance.g.cs | 26 ++++++++--------- .../Quantities/AmplitudeRatio.g.cs | 26 ++++++++--------- UnitsNet/GeneratedCode/Quantities/Angle.g.cs | 26 ++++++++--------- .../Quantities/ApparentEnergy.g.cs | 26 ++++++++--------- .../Quantities/ApparentPower.g.cs | 26 ++++++++--------- UnitsNet/GeneratedCode/Quantities/Area.g.cs | 26 ++++++++--------- .../GeneratedCode/Quantities/AreaDensity.g.cs | 26 ++++++++--------- .../Quantities/AreaMomentOfInertia.g.cs | 26 ++++++++--------- .../GeneratedCode/Quantities/BitRate.g.cs | 20 ++++++------- .../BrakeSpecificFuelConsumption.g.cs | 26 ++++++++--------- .../GeneratedCode/Quantities/Capacitance.g.cs | 26 ++++++++--------- .../GeneratedCode/Quantities/Density.g.cs | 26 ++++++++--------- .../GeneratedCode/Quantities/Duration.g.cs | 26 ++++++++--------- .../Quantities/DynamicViscosity.g.cs | 26 ++++++++--------- .../Quantities/ElectricAdmittance.g.cs | 26 ++++++++--------- .../Quantities/ElectricCharge.g.cs | 26 ++++++++--------- .../Quantities/ElectricChargeDensity.g.cs | 26 ++++++++--------- .../Quantities/ElectricConductance.g.cs | 26 ++++++++--------- .../Quantities/ElectricConductivity.g.cs | 26 ++++++++--------- .../Quantities/ElectricCurrent.g.cs | 26 ++++++++--------- .../Quantities/ElectricCurrentDensity.g.cs | 26 ++++++++--------- .../Quantities/ElectricCurrentGradient.g.cs | 26 ++++++++--------- .../Quantities/ElectricField.g.cs | 26 ++++++++--------- .../Quantities/ElectricInductance.g.cs | 26 ++++++++--------- .../Quantities/ElectricPotential.g.cs | 26 ++++++++--------- .../Quantities/ElectricPotentialAc.g.cs | 26 ++++++++--------- .../Quantities/ElectricPotentialDc.g.cs | 26 ++++++++--------- .../Quantities/ElectricResistance.g.cs | 26 ++++++++--------- .../Quantities/ElectricResistivity.g.cs | 26 ++++++++--------- UnitsNet/GeneratedCode/Quantities/Energy.g.cs | 26 ++++++++--------- .../GeneratedCode/Quantities/Entropy.g.cs | 26 ++++++++--------- UnitsNet/GeneratedCode/Quantities/Flow.g.cs | 26 ++++++++--------- UnitsNet/GeneratedCode/Quantities/Force.g.cs | 26 ++++++++--------- .../Quantities/ForceChangeRate.g.cs | 26 ++++++++--------- .../Quantities/ForcePerLength.g.cs | 26 ++++++++--------- .../GeneratedCode/Quantities/Frequency.g.cs | 26 ++++++++--------- .../GeneratedCode/Quantities/HeatFlux.g.cs | 26 ++++++++--------- .../Quantities/HeatTransferCoefficient.g.cs | 26 ++++++++--------- .../GeneratedCode/Quantities/Illuminance.g.cs | 26 ++++++++--------- .../GeneratedCode/Quantities/Information.g.cs | 20 ++++++------- .../GeneratedCode/Quantities/Irradiance.g.cs | 26 ++++++++--------- .../GeneratedCode/Quantities/Irradiation.g.cs | 26 ++++++++--------- .../Quantities/KinematicViscosity.g.cs | 26 ++++++++--------- .../GeneratedCode/Quantities/LapseRate.g.cs | 26 ++++++++--------- UnitsNet/GeneratedCode/Quantities/Length.g.cs | 26 ++++++++--------- UnitsNet/GeneratedCode/Quantities/Level.g.cs | 26 ++++++++--------- .../Quantities/LinearDensity.g.cs | 26 ++++++++--------- .../Quantities/LuminousFlux.g.cs | 26 ++++++++--------- .../Quantities/LuminousIntensity.g.cs | 26 ++++++++--------- .../Quantities/MagneticField.g.cs | 26 ++++++++--------- .../Quantities/MagneticFlux.g.cs | 26 ++++++++--------- .../Quantities/Magnetization.g.cs | 26 ++++++++--------- UnitsNet/GeneratedCode/Quantities/Mass.g.cs | 26 ++++++++--------- .../GeneratedCode/Quantities/MassFlow.g.cs | 26 ++++++++--------- .../GeneratedCode/Quantities/MassFlux.g.cs | 26 ++++++++--------- .../Quantities/MassMomentOfInertia.g.cs | 26 ++++++++--------- .../GeneratedCode/Quantities/MolarEnergy.g.cs | 26 ++++++++--------- .../Quantities/MolarEntropy.g.cs | 26 ++++++++--------- .../GeneratedCode/Quantities/MolarMass.g.cs | 26 ++++++++--------- .../GeneratedCode/Quantities/Molarity.g.cs | 26 ++++++++--------- .../Quantities/Permeability.g.cs | 26 ++++++++--------- .../Quantities/Permittivity.g.cs | 26 ++++++++--------- UnitsNet/GeneratedCode/Quantities/Power.g.cs | 20 ++++++------- .../Quantities/PowerDensity.g.cs | 26 ++++++++--------- .../GeneratedCode/Quantities/PowerRatio.g.cs | 26 ++++++++--------- .../GeneratedCode/Quantities/Pressure.g.cs | 26 ++++++++--------- .../Quantities/PressureChangeRate.g.cs | 26 ++++++++--------- UnitsNet/GeneratedCode/Quantities/Ratio.g.cs | 26 ++++++++--------- .../Quantities/ReactiveEnergy.g.cs | 26 ++++++++--------- .../Quantities/ReactivePower.g.cs | 26 ++++++++--------- .../Quantities/RotationalAcceleration.g.cs | 26 ++++++++--------- .../Quantities/RotationalSpeed.g.cs | 26 ++++++++--------- .../Quantities/RotationalStiffness.g.cs | 26 ++++++++--------- .../RotationalStiffnessPerLength.g.cs | 26 ++++++++--------- .../GeneratedCode/Quantities/SolidAngle.g.cs | 26 ++++++++--------- .../Quantities/SpecificEnergy.g.cs | 26 ++++++++--------- .../Quantities/SpecificEntropy.g.cs | 26 ++++++++--------- .../Quantities/SpecificVolume.g.cs | 26 ++++++++--------- .../Quantities/SpecificWeight.g.cs | 26 ++++++++--------- UnitsNet/GeneratedCode/Quantities/Speed.g.cs | 26 ++++++++--------- .../GeneratedCode/Quantities/Temperature.g.cs | 26 ++++++++--------- .../Quantities/TemperatureChangeRate.g.cs | 26 ++++++++--------- .../Quantities/TemperatureDelta.g.cs | 26 ++++++++--------- .../Quantities/ThermalConductivity.g.cs | 26 ++++++++--------- .../Quantities/ThermalResistance.g.cs | 26 ++++++++--------- UnitsNet/GeneratedCode/Quantities/Torque.g.cs | 26 ++++++++--------- .../GeneratedCode/Quantities/VitaminA.g.cs | 26 ++++++++--------- UnitsNet/GeneratedCode/Quantities/Volume.g.cs | 26 ++++++++--------- .../GeneratedCode/Quantities/VolumeFlow.g.cs | 26 ++++++++--------- .../Include-GenerateQuantitySourceCode.ps1 | 28 +++++++++---------- 91 files changed, 1175 insertions(+), 1175 deletions(-) diff --git a/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs b/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs index 1ac631fa9d..fbf56df5f4 100644 --- a/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs @@ -764,14 +764,14 @@ int CompareTo(Acceleration other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(Acceleration left, Acceleration right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(Acceleration left, Acceleration right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -779,15 +779,14 @@ int CompareTo(Acceleration other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is Acceleration)) return false; - } - return AsBaseUnitMetersPerSecondSquared().Equals(((Acceleration) obj).AsBaseUnitMetersPerSecondSquared()); + var objQuantity = (Acceleration)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -849,9 +848,10 @@ public bool Equals(Acceleration other, double tolerance, ComparisonType comparis /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(Acceleration, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(Acceleration other, Acceleration maxError) { - return Math.Abs(AsBaseUnitMetersPerSecondSquared() - other.AsBaseUnitMetersPerSecondSquared()) <= maxError.AsBaseUnitMetersPerSecondSquared(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -1250,7 +1250,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitMetersPerSecondSquared() { - if (Unit == AccelerationUnit.MeterPerSecondSquared) { return _value; } + if (Unit == AccelerationUnit.MeterPerSecondSquared) { return _value; } switch (Unit) { @@ -1269,10 +1269,10 @@ private double AsBaseUnitMetersPerSecondSquared() case AccelerationUnit.StandardGravity: return _value*9.80665; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(AccelerationUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs index b63522121d..123d5b41a8 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs @@ -797,14 +797,14 @@ int CompareTo(AmountOfSubstance other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(AmountOfSubstance left, AmountOfSubstance right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(AmountOfSubstance left, AmountOfSubstance right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -812,15 +812,14 @@ int CompareTo(AmountOfSubstance other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is AmountOfSubstance)) return false; - } - return AsBaseUnitMoles().Equals(((AmountOfSubstance) obj).AsBaseUnitMoles()); + var objQuantity = (AmountOfSubstance)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -882,9 +881,10 @@ public bool Equals(AmountOfSubstance other, double tolerance, ComparisonType com /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(AmountOfSubstance, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(AmountOfSubstance other, AmountOfSubstance maxError) { - return Math.Abs(AsBaseUnitMoles() - other.AsBaseUnitMoles()) <= maxError.AsBaseUnitMoles(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -1284,7 +1284,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitMoles() { - if (Unit == AmountOfSubstanceUnit.Mole) { return _value; } + if (Unit == AmountOfSubstanceUnit.Mole) { return _value; } switch (Unit) { @@ -1304,10 +1304,10 @@ private double AsBaseUnitMoles() case AmountOfSubstanceUnit.PoundMole: return _value*453.59237; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(AmountOfSubstanceUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs index ac9ba3c543..3b09badad1 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs @@ -475,14 +475,14 @@ int CompareTo(AmplitudeRatio other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(AmplitudeRatio left, AmplitudeRatio right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(AmplitudeRatio left, AmplitudeRatio right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -490,15 +490,14 @@ int CompareTo(AmplitudeRatio other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is AmplitudeRatio)) return false; - } - return AsBaseUnitDecibelVolts().Equals(((AmplitudeRatio) obj).AsBaseUnitDecibelVolts()); + var objQuantity = (AmplitudeRatio)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -560,9 +559,10 @@ public bool Equals(AmplitudeRatio other, double tolerance, ComparisonType compar /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(AmplitudeRatio, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(AmplitudeRatio other, AmplitudeRatio maxError) { - return Math.Abs(AsBaseUnitDecibelVolts() - other.AsBaseUnitDecibelVolts()) <= maxError.AsBaseUnitDecibelVolts(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -952,7 +952,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitDecibelVolts() { - if (Unit == AmplitudeRatioUnit.DecibelVolt) { return _value; } + if (Unit == AmplitudeRatioUnit.DecibelVolt) { return _value; } switch (Unit) { @@ -962,10 +962,10 @@ private double AsBaseUnitDecibelVolts() case AmplitudeRatioUnit.DecibelVolt: return _value; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(AmplitudeRatioUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/Angle.g.cs b/UnitsNet/GeneratedCode/Quantities/Angle.g.cs index 21b7659d27..74f377860f 100644 --- a/UnitsNet/GeneratedCode/Quantities/Angle.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Angle.g.cs @@ -797,14 +797,14 @@ int CompareTo(Angle other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(Angle left, Angle right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(Angle left, Angle right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -812,15 +812,14 @@ int CompareTo(Angle other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is Angle)) return false; - } - return AsBaseUnitDegrees().Equals(((Angle) obj).AsBaseUnitDegrees()); + var objQuantity = (Angle)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -882,9 +881,10 @@ public bool Equals(Angle other, double tolerance, ComparisonType comparisonType) /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(Angle, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(Angle other, Angle maxError) { - return Math.Abs(AsBaseUnitDegrees() - other.AsBaseUnitDegrees()) <= maxError.AsBaseUnitDegrees(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -1284,7 +1284,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitDegrees() { - if (Unit == AngleUnit.Degree) { return _value; } + if (Unit == AngleUnit.Degree) { return _value; } switch (Unit) { @@ -1304,10 +1304,10 @@ private double AsBaseUnitDegrees() case AngleUnit.Revolution: return _value*360; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(AngleUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs index a647099c0d..7430688cd0 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs @@ -434,14 +434,14 @@ int CompareTo(ApparentEnergy other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(ApparentEnergy left, ApparentEnergy right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(ApparentEnergy left, ApparentEnergy right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -449,15 +449,14 @@ int CompareTo(ApparentEnergy other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is ApparentEnergy)) return false; - } - return AsBaseUnitVoltampereHours().Equals(((ApparentEnergy) obj).AsBaseUnitVoltampereHours()); + var objQuantity = (ApparentEnergy)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -519,9 +518,10 @@ public bool Equals(ApparentEnergy other, double tolerance, ComparisonType compar /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(ApparentEnergy, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(ApparentEnergy other, ApparentEnergy maxError) { - return Math.Abs(AsBaseUnitVoltampereHours() - other.AsBaseUnitVoltampereHours()) <= maxError.AsBaseUnitVoltampereHours(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -910,7 +910,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitVoltampereHours() { - if (Unit == ApparentEnergyUnit.VoltampereHour) { return _value; } + if (Unit == ApparentEnergyUnit.VoltampereHour) { return _value; } switch (Unit) { @@ -919,10 +919,10 @@ private double AsBaseUnitVoltampereHours() case ApparentEnergyUnit.VoltampereHour: return _value; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(ApparentEnergyUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs index 85b91d190b..46a93282e7 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs @@ -467,14 +467,14 @@ int CompareTo(ApparentPower other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(ApparentPower left, ApparentPower right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(ApparentPower left, ApparentPower right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -482,15 +482,14 @@ int CompareTo(ApparentPower other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is ApparentPower)) return false; - } - return AsBaseUnitVoltamperes().Equals(((ApparentPower) obj).AsBaseUnitVoltamperes()); + var objQuantity = (ApparentPower)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -552,9 +551,10 @@ public bool Equals(ApparentPower other, double tolerance, ComparisonType compari /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(ApparentPower, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(ApparentPower other, ApparentPower maxError) { - return Math.Abs(AsBaseUnitVoltamperes() - other.AsBaseUnitVoltamperes()) <= maxError.AsBaseUnitVoltamperes(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -944,7 +944,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitVoltamperes() { - if (Unit == ApparentPowerUnit.Voltampere) { return _value; } + if (Unit == ApparentPowerUnit.Voltampere) { return _value; } switch (Unit) { @@ -954,10 +954,10 @@ private double AsBaseUnitVoltamperes() case ApparentPowerUnit.Voltampere: return _value; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(ApparentPowerUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/Area.g.cs b/UnitsNet/GeneratedCode/Quantities/Area.g.cs index e0b8db9165..3869be2733 100644 --- a/UnitsNet/GeneratedCode/Quantities/Area.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Area.g.cs @@ -764,14 +764,14 @@ int CompareTo(Area other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(Area left, Area right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(Area left, Area right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -779,15 +779,14 @@ int CompareTo(Area other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is Area)) return false; - } - return AsBaseUnitSquareMeters().Equals(((Area) obj).AsBaseUnitSquareMeters()); + var objQuantity = (Area)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -849,9 +848,10 @@ public bool Equals(Area other, double tolerance, ComparisonType comparisonType) /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(Area, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(Area other, Area maxError) { - return Math.Abs(AsBaseUnitSquareMeters() - other.AsBaseUnitSquareMeters()) <= maxError.AsBaseUnitSquareMeters(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -1250,7 +1250,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitSquareMeters() { - if (Unit == AreaUnit.SquareMeter) { return _value; } + if (Unit == AreaUnit.SquareMeter) { return _value; } switch (Unit) { @@ -1269,10 +1269,10 @@ private double AsBaseUnitSquareMeters() case AreaUnit.UsSurveySquareFoot: return _value*0.09290341161; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(AreaUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs index 8e29e81280..0840f0f9d4 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs @@ -368,14 +368,14 @@ int CompareTo(AreaDensity other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(AreaDensity left, AreaDensity right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(AreaDensity left, AreaDensity right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -383,15 +383,14 @@ int CompareTo(AreaDensity other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is AreaDensity)) return false; - } - return AsBaseUnitKilogramsPerSquareMeter().Equals(((AreaDensity) obj).AsBaseUnitKilogramsPerSquareMeter()); + var objQuantity = (AreaDensity)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -453,9 +452,10 @@ public bool Equals(AreaDensity other, double tolerance, ComparisonType compariso /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(AreaDensity, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(AreaDensity other, AreaDensity maxError) { - return Math.Abs(AsBaseUnitKilogramsPerSquareMeter() - other.AsBaseUnitKilogramsPerSquareMeter()) <= maxError.AsBaseUnitKilogramsPerSquareMeter(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -842,17 +842,17 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitKilogramsPerSquareMeter() { - if (Unit == AreaDensityUnit.KilogramPerSquareMeter) { return _value; } + if (Unit == AreaDensityUnit.KilogramPerSquareMeter) { return _value; } switch (Unit) { case AreaDensityUnit.KilogramPerSquareMeter: return _value; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(AreaDensityUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs index 4c827cba29..edf0cd40b2 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs @@ -533,14 +533,14 @@ int CompareTo(AreaMomentOfInertia other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(AreaMomentOfInertia left, AreaMomentOfInertia right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(AreaMomentOfInertia left, AreaMomentOfInertia right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -548,15 +548,14 @@ int CompareTo(AreaMomentOfInertia other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is AreaMomentOfInertia)) return false; - } - return AsBaseUnitMetersToTheFourth().Equals(((AreaMomentOfInertia) obj).AsBaseUnitMetersToTheFourth()); + var objQuantity = (AreaMomentOfInertia)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -618,9 +617,10 @@ public bool Equals(AreaMomentOfInertia other, double tolerance, ComparisonType c /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(AreaMomentOfInertia, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(AreaMomentOfInertia other, AreaMomentOfInertia maxError) { - return Math.Abs(AsBaseUnitMetersToTheFourth() - other.AsBaseUnitMetersToTheFourth()) <= maxError.AsBaseUnitMetersToTheFourth(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -1012,7 +1012,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitMetersToTheFourth() { - if (Unit == AreaMomentOfInertiaUnit.MeterToTheFourth) { return _value; } + if (Unit == AreaMomentOfInertiaUnit.MeterToTheFourth) { return _value; } switch (Unit) { @@ -1024,10 +1024,10 @@ private double AsBaseUnitMetersToTheFourth() case AreaMomentOfInertiaUnit.MillimeterToTheFourth: return _value/1e12; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(AreaMomentOfInertiaUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/BitRate.g.cs b/UnitsNet/GeneratedCode/Quantities/BitRate.g.cs index c5248bb3d5..0d2b14e073 100644 --- a/UnitsNet/GeneratedCode/Quantities/BitRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BitRate.g.cs @@ -1208,12 +1208,11 @@ int CompareTo(BitRate other) public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is BitRate)) return false; - } - return AsBaseUnitBitsPerSecond().Equals(((BitRate) obj).AsBaseUnitBitsPerSecond()); + var objQuantity = (BitRate)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -1275,9 +1274,10 @@ public bool Equals(BitRate other, double tolerance, ComparisonType comparisonTyp /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(BitRate, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(BitRate other, BitRate maxError) { - return Math.Abs(AsBaseUnitBitsPerSecond() - other.AsBaseUnitBitsPerSecond()) <= maxError.AsBaseUnitBitsPerSecond(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -1689,7 +1689,7 @@ public string ToString( /// The value in the base unit representation. private decimal AsBaseUnitBitsPerSecond() { - if (Unit == BitRateUnit.BitPerSecond) { return _value; } + if (Unit == BitRateUnit.BitPerSecond) { return _value; } switch (Unit) { @@ -1721,10 +1721,10 @@ private decimal AsBaseUnitBitsPerSecond() case BitRateUnit.TerabytePerSecond: return Convert.ToDecimal((_value*8m) * 1e12m); default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private decimal AsBaseNumericType(BitRateUnit unit) => Convert.ToDecimal(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs index a5840859f6..885dcabab1 100644 --- a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs @@ -434,14 +434,14 @@ int CompareTo(BrakeSpecificFuelConsumption other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(BrakeSpecificFuelConsumption left, BrakeSpecificFuelConsumption right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(BrakeSpecificFuelConsumption left, BrakeSpecificFuelConsumption right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -449,15 +449,14 @@ int CompareTo(BrakeSpecificFuelConsumption other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is BrakeSpecificFuelConsumption)) return false; - } - return AsBaseUnitKilogramsPerJoule().Equals(((BrakeSpecificFuelConsumption) obj).AsBaseUnitKilogramsPerJoule()); + var objQuantity = (BrakeSpecificFuelConsumption)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -519,9 +518,10 @@ public bool Equals(BrakeSpecificFuelConsumption other, double tolerance, Compari /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(BrakeSpecificFuelConsumption, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(BrakeSpecificFuelConsumption other, BrakeSpecificFuelConsumption maxError) { - return Math.Abs(AsBaseUnitKilogramsPerJoule() - other.AsBaseUnitKilogramsPerJoule()) <= maxError.AsBaseUnitKilogramsPerJoule(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -910,7 +910,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitKilogramsPerJoule() { - if (Unit == BrakeSpecificFuelConsumptionUnit.KilogramPerJoule) { return _value; } + if (Unit == BrakeSpecificFuelConsumptionUnit.KilogramPerJoule) { return _value; } switch (Unit) { @@ -919,10 +919,10 @@ private double AsBaseUnitKilogramsPerJoule() case BrakeSpecificFuelConsumptionUnit.PoundPerMechanicalHorsepowerHour: return _value*1.689659410672e-7; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(BrakeSpecificFuelConsumptionUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/Capacitance.g.cs b/UnitsNet/GeneratedCode/Quantities/Capacitance.g.cs index d820a0b0eb..e39c09b02c 100644 --- a/UnitsNet/GeneratedCode/Quantities/Capacitance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Capacitance.g.cs @@ -368,14 +368,14 @@ int CompareTo(Capacitance other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(Capacitance left, Capacitance right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(Capacitance left, Capacitance right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -383,15 +383,14 @@ int CompareTo(Capacitance other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is Capacitance)) return false; - } - return AsBaseUnitFarads().Equals(((Capacitance) obj).AsBaseUnitFarads()); + var objQuantity = (Capacitance)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -453,9 +452,10 @@ public bool Equals(Capacitance other, double tolerance, ComparisonType compariso /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(Capacitance, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(Capacitance other, Capacitance maxError) { - return Math.Abs(AsBaseUnitFarads() - other.AsBaseUnitFarads()) <= maxError.AsBaseUnitFarads(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -842,17 +842,17 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitFarads() { - if (Unit == CapacitanceUnit.Farad) { return _value; } + if (Unit == CapacitanceUnit.Farad) { return _value; } switch (Unit) { case CapacitanceUnit.Farad: return _value; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(CapacitanceUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/Density.g.cs b/UnitsNet/GeneratedCode/Quantities/Density.g.cs index f14f2a42a7..4304f2cc6f 100644 --- a/UnitsNet/GeneratedCode/Quantities/Density.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Density.g.cs @@ -1589,14 +1589,14 @@ int CompareTo(Density other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(Density left, Density right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(Density left, Density right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -1604,15 +1604,14 @@ int CompareTo(Density other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is Density)) return false; - } - return AsBaseUnitKilogramsPerCubicMeter().Equals(((Density) obj).AsBaseUnitKilogramsPerCubicMeter()); + var objQuantity = (Density)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -1674,9 +1673,10 @@ public bool Equals(Density other, double tolerance, ComparisonType comparisonTyp /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(Density, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(Density other, Density maxError) { - return Math.Abs(AsBaseUnitKilogramsPerCubicMeter() - other.AsBaseUnitKilogramsPerCubicMeter()) <= maxError.AsBaseUnitKilogramsPerCubicMeter(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -2100,7 +2100,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitKilogramsPerCubicMeter() { - if (Unit == DensityUnit.KilogramPerCubicMeter) { return _value; } + if (Unit == DensityUnit.KilogramPerCubicMeter) { return _value; } switch (Unit) { @@ -2144,10 +2144,10 @@ private double AsBaseUnitKilogramsPerCubicMeter() case DensityUnit.TonnePerCubicMillimeter: return _value/1e-12; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(DensityUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/Duration.g.cs b/UnitsNet/GeneratedCode/Quantities/Duration.g.cs index 2a3ccaadf2..bd38a67e50 100644 --- a/UnitsNet/GeneratedCode/Quantities/Duration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Duration.g.cs @@ -733,14 +733,14 @@ int CompareTo(Duration other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(Duration left, Duration right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(Duration left, Duration right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -748,15 +748,14 @@ int CompareTo(Duration other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is Duration)) return false; - } - return AsBaseUnitSeconds().Equals(((Duration) obj).AsBaseUnitSeconds()); + var objQuantity = (Duration)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -818,9 +817,10 @@ public bool Equals(Duration other, double tolerance, ComparisonType comparisonTy /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(Duration, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(Duration other, Duration maxError) { - return Math.Abs(AsBaseUnitSeconds() - other.AsBaseUnitSeconds()) <= maxError.AsBaseUnitSeconds(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -1218,7 +1218,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitSeconds() { - if (Unit == DurationUnit.Second) { return _value; } + if (Unit == DurationUnit.Second) { return _value; } switch (Unit) { @@ -1236,10 +1236,10 @@ private double AsBaseUnitSeconds() case DurationUnit.Year365: return _value*365*24*3600; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(DurationUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs index e1bdb9b86d..ff6aeeac51 100644 --- a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs @@ -533,14 +533,14 @@ int CompareTo(DynamicViscosity other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(DynamicViscosity left, DynamicViscosity right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(DynamicViscosity left, DynamicViscosity right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -548,15 +548,14 @@ int CompareTo(DynamicViscosity other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is DynamicViscosity)) return false; - } - return AsBaseUnitNewtonSecondsPerMeterSquared().Equals(((DynamicViscosity) obj).AsBaseUnitNewtonSecondsPerMeterSquared()); + var objQuantity = (DynamicViscosity)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -618,9 +617,10 @@ public bool Equals(DynamicViscosity other, double tolerance, ComparisonType comp /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(DynamicViscosity, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(DynamicViscosity other, DynamicViscosity maxError) { - return Math.Abs(AsBaseUnitNewtonSecondsPerMeterSquared() - other.AsBaseUnitNewtonSecondsPerMeterSquared()) <= maxError.AsBaseUnitNewtonSecondsPerMeterSquared(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -1012,7 +1012,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitNewtonSecondsPerMeterSquared() { - if (Unit == DynamicViscosityUnit.NewtonSecondPerMeterSquared) { return _value; } + if (Unit == DynamicViscosityUnit.NewtonSecondPerMeterSquared) { return _value; } switch (Unit) { @@ -1024,10 +1024,10 @@ private double AsBaseUnitNewtonSecondsPerMeterSquared() case DynamicViscosityUnit.Poise: return _value/10; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(DynamicViscosityUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs index ec7a0bd239..05b16ff7b9 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs @@ -467,14 +467,14 @@ int CompareTo(ElectricAdmittance other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(ElectricAdmittance left, ElectricAdmittance right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(ElectricAdmittance left, ElectricAdmittance right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -482,15 +482,14 @@ int CompareTo(ElectricAdmittance other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is ElectricAdmittance)) return false; - } - return AsBaseUnitSiemens().Equals(((ElectricAdmittance) obj).AsBaseUnitSiemens()); + var objQuantity = (ElectricAdmittance)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -552,9 +551,10 @@ public bool Equals(ElectricAdmittance other, double tolerance, ComparisonType co /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(ElectricAdmittance, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(ElectricAdmittance other, ElectricAdmittance maxError) { - return Math.Abs(AsBaseUnitSiemens() - other.AsBaseUnitSiemens()) <= maxError.AsBaseUnitSiemens(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -944,7 +944,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitSiemens() { - if (Unit == ElectricAdmittanceUnit.Siemens) { return _value; } + if (Unit == ElectricAdmittanceUnit.Siemens) { return _value; } switch (Unit) { @@ -954,10 +954,10 @@ private double AsBaseUnitSiemens() case ElectricAdmittanceUnit.Siemens: return _value; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(ElectricAdmittanceUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs index 2e65e27a2c..c0cb855b08 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs @@ -368,14 +368,14 @@ int CompareTo(ElectricCharge other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(ElectricCharge left, ElectricCharge right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(ElectricCharge left, ElectricCharge right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -383,15 +383,14 @@ int CompareTo(ElectricCharge other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is ElectricCharge)) return false; - } - return AsBaseUnitCoulombs().Equals(((ElectricCharge) obj).AsBaseUnitCoulombs()); + var objQuantity = (ElectricCharge)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -453,9 +452,10 @@ public bool Equals(ElectricCharge other, double tolerance, ComparisonType compar /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(ElectricCharge, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(ElectricCharge other, ElectricCharge maxError) { - return Math.Abs(AsBaseUnitCoulombs() - other.AsBaseUnitCoulombs()) <= maxError.AsBaseUnitCoulombs(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -842,17 +842,17 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitCoulombs() { - if (Unit == ElectricChargeUnit.Coulomb) { return _value; } + if (Unit == ElectricChargeUnit.Coulomb) { return _value; } switch (Unit) { case ElectricChargeUnit.Coulomb: return _value; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(ElectricChargeUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs index 88edcfbb13..8b3785997e 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs @@ -368,14 +368,14 @@ int CompareTo(ElectricChargeDensity other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(ElectricChargeDensity left, ElectricChargeDensity right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(ElectricChargeDensity left, ElectricChargeDensity right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -383,15 +383,14 @@ int CompareTo(ElectricChargeDensity other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is ElectricChargeDensity)) return false; - } - return AsBaseUnitCoulombsPerCubicMeter().Equals(((ElectricChargeDensity) obj).AsBaseUnitCoulombsPerCubicMeter()); + var objQuantity = (ElectricChargeDensity)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -453,9 +452,10 @@ public bool Equals(ElectricChargeDensity other, double tolerance, ComparisonType /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(ElectricChargeDensity, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(ElectricChargeDensity other, ElectricChargeDensity maxError) { - return Math.Abs(AsBaseUnitCoulombsPerCubicMeter() - other.AsBaseUnitCoulombsPerCubicMeter()) <= maxError.AsBaseUnitCoulombsPerCubicMeter(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -842,17 +842,17 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitCoulombsPerCubicMeter() { - if (Unit == ElectricChargeDensityUnit.CoulombPerCubicMeter) { return _value; } + if (Unit == ElectricChargeDensityUnit.CoulombPerCubicMeter) { return _value; } switch (Unit) { case ElectricChargeDensityUnit.CoulombPerCubicMeter: return _value; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(ElectricChargeDensityUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs index afcb0ba0e3..05aaf60dba 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs @@ -434,14 +434,14 @@ int CompareTo(ElectricConductance other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(ElectricConductance left, ElectricConductance right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(ElectricConductance left, ElectricConductance right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -449,15 +449,14 @@ int CompareTo(ElectricConductance other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is ElectricConductance)) return false; - } - return AsBaseUnitSiemens().Equals(((ElectricConductance) obj).AsBaseUnitSiemens()); + var objQuantity = (ElectricConductance)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -519,9 +518,10 @@ public bool Equals(ElectricConductance other, double tolerance, ComparisonType c /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(ElectricConductance, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(ElectricConductance other, ElectricConductance maxError) { - return Math.Abs(AsBaseUnitSiemens() - other.AsBaseUnitSiemens()) <= maxError.AsBaseUnitSiemens(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -910,7 +910,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitSiemens() { - if (Unit == ElectricConductanceUnit.Siemens) { return _value; } + if (Unit == ElectricConductanceUnit.Siemens) { return _value; } switch (Unit) { @@ -919,10 +919,10 @@ private double AsBaseUnitSiemens() case ElectricConductanceUnit.Siemens: return _value; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(ElectricConductanceUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs index ff71f2acec..b7799d6651 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs @@ -368,14 +368,14 @@ int CompareTo(ElectricConductivity other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(ElectricConductivity left, ElectricConductivity right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(ElectricConductivity left, ElectricConductivity right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -383,15 +383,14 @@ int CompareTo(ElectricConductivity other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is ElectricConductivity)) return false; - } - return AsBaseUnitSiemensPerMeter().Equals(((ElectricConductivity) obj).AsBaseUnitSiemensPerMeter()); + var objQuantity = (ElectricConductivity)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -453,9 +452,10 @@ public bool Equals(ElectricConductivity other, double tolerance, ComparisonType /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(ElectricConductivity, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(ElectricConductivity other, ElectricConductivity maxError) { - return Math.Abs(AsBaseUnitSiemensPerMeter() - other.AsBaseUnitSiemensPerMeter()) <= maxError.AsBaseUnitSiemensPerMeter(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -842,17 +842,17 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitSiemensPerMeter() { - if (Unit == ElectricConductivityUnit.SiemensPerMeter) { return _value; } + if (Unit == ElectricConductivityUnit.SiemensPerMeter) { return _value; } switch (Unit) { case ElectricConductivityUnit.SiemensPerMeter: return _value; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(ElectricConductivityUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs index cb2ea51b91..e5085be357 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs @@ -566,14 +566,14 @@ int CompareTo(ElectricCurrent other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(ElectricCurrent left, ElectricCurrent right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(ElectricCurrent left, ElectricCurrent right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -581,15 +581,14 @@ int CompareTo(ElectricCurrent other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is ElectricCurrent)) return false; - } - return AsBaseUnitAmperes().Equals(((ElectricCurrent) obj).AsBaseUnitAmperes()); + var objQuantity = (ElectricCurrent)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -651,9 +650,10 @@ public bool Equals(ElectricCurrent other, double tolerance, ComparisonType compa /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(ElectricCurrent, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(ElectricCurrent other, ElectricCurrent maxError) { - return Math.Abs(AsBaseUnitAmperes() - other.AsBaseUnitAmperes()) <= maxError.AsBaseUnitAmperes(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -1046,7 +1046,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitAmperes() { - if (Unit == ElectricCurrentUnit.Ampere) { return _value; } + if (Unit == ElectricCurrentUnit.Ampere) { return _value; } switch (Unit) { @@ -1059,10 +1059,10 @@ private double AsBaseUnitAmperes() case ElectricCurrentUnit.Picoampere: return (_value) * 1e-12d; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(ElectricCurrentUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs index 3671a23d7b..265295467c 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs @@ -368,14 +368,14 @@ int CompareTo(ElectricCurrentDensity other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(ElectricCurrentDensity left, ElectricCurrentDensity right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(ElectricCurrentDensity left, ElectricCurrentDensity right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -383,15 +383,14 @@ int CompareTo(ElectricCurrentDensity other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is ElectricCurrentDensity)) return false; - } - return AsBaseUnitAmperesPerSquareMeter().Equals(((ElectricCurrentDensity) obj).AsBaseUnitAmperesPerSquareMeter()); + var objQuantity = (ElectricCurrentDensity)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -453,9 +452,10 @@ public bool Equals(ElectricCurrentDensity other, double tolerance, ComparisonTyp /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(ElectricCurrentDensity, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(ElectricCurrentDensity other, ElectricCurrentDensity maxError) { - return Math.Abs(AsBaseUnitAmperesPerSquareMeter() - other.AsBaseUnitAmperesPerSquareMeter()) <= maxError.AsBaseUnitAmperesPerSquareMeter(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -842,17 +842,17 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitAmperesPerSquareMeter() { - if (Unit == ElectricCurrentDensityUnit.AmperePerSquareMeter) { return _value; } + if (Unit == ElectricCurrentDensityUnit.AmperePerSquareMeter) { return _value; } switch (Unit) { case ElectricCurrentDensityUnit.AmperePerSquareMeter: return _value; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(ElectricCurrentDensityUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs index a37c5bfcb3..0affead6f5 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs @@ -368,14 +368,14 @@ int CompareTo(ElectricCurrentGradient other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(ElectricCurrentGradient left, ElectricCurrentGradient right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(ElectricCurrentGradient left, ElectricCurrentGradient right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -383,15 +383,14 @@ int CompareTo(ElectricCurrentGradient other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is ElectricCurrentGradient)) return false; - } - return AsBaseUnitAmperesPerSecond().Equals(((ElectricCurrentGradient) obj).AsBaseUnitAmperesPerSecond()); + var objQuantity = (ElectricCurrentGradient)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -453,9 +452,10 @@ public bool Equals(ElectricCurrentGradient other, double tolerance, ComparisonTy /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(ElectricCurrentGradient, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(ElectricCurrentGradient other, ElectricCurrentGradient maxError) { - return Math.Abs(AsBaseUnitAmperesPerSecond() - other.AsBaseUnitAmperesPerSecond()) <= maxError.AsBaseUnitAmperesPerSecond(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -842,17 +842,17 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitAmperesPerSecond() { - if (Unit == ElectricCurrentGradientUnit.AmperePerSecond) { return _value; } + if (Unit == ElectricCurrentGradientUnit.AmperePerSecond) { return _value; } switch (Unit) { case ElectricCurrentGradientUnit.AmperePerSecond: return _value; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(ElectricCurrentGradientUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs index c2aa8d89a8..d2e3fe72ee 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs @@ -368,14 +368,14 @@ int CompareTo(ElectricField other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(ElectricField left, ElectricField right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(ElectricField left, ElectricField right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -383,15 +383,14 @@ int CompareTo(ElectricField other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is ElectricField)) return false; - } - return AsBaseUnitVoltsPerMeter().Equals(((ElectricField) obj).AsBaseUnitVoltsPerMeter()); + var objQuantity = (ElectricField)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -453,9 +452,10 @@ public bool Equals(ElectricField other, double tolerance, ComparisonType compari /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(ElectricField, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(ElectricField other, ElectricField maxError) { - return Math.Abs(AsBaseUnitVoltsPerMeter() - other.AsBaseUnitVoltsPerMeter()) <= maxError.AsBaseUnitVoltsPerMeter(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -842,17 +842,17 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitVoltsPerMeter() { - if (Unit == ElectricFieldUnit.VoltPerMeter) { return _value; } + if (Unit == ElectricFieldUnit.VoltPerMeter) { return _value; } switch (Unit) { case ElectricFieldUnit.VoltPerMeter: return _value; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(ElectricFieldUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs index 695a33f5cd..bf105a14b7 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs @@ -368,14 +368,14 @@ int CompareTo(ElectricInductance other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(ElectricInductance left, ElectricInductance right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(ElectricInductance left, ElectricInductance right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -383,15 +383,14 @@ int CompareTo(ElectricInductance other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is ElectricInductance)) return false; - } - return AsBaseUnitHenries().Equals(((ElectricInductance) obj).AsBaseUnitHenries()); + var objQuantity = (ElectricInductance)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -453,9 +452,10 @@ public bool Equals(ElectricInductance other, double tolerance, ComparisonType co /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(ElectricInductance, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(ElectricInductance other, ElectricInductance maxError) { - return Math.Abs(AsBaseUnitHenries() - other.AsBaseUnitHenries()) <= maxError.AsBaseUnitHenries(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -842,17 +842,17 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitHenries() { - if (Unit == ElectricInductanceUnit.Henry) { return _value; } + if (Unit == ElectricInductanceUnit.Henry) { return _value; } switch (Unit) { case ElectricInductanceUnit.Henry: return _value; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(ElectricInductanceUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs index 364d5a0175..c55f5f9175 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs @@ -500,14 +500,14 @@ int CompareTo(ElectricPotential other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(ElectricPotential left, ElectricPotential right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(ElectricPotential left, ElectricPotential right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -515,15 +515,14 @@ int CompareTo(ElectricPotential other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is ElectricPotential)) return false; - } - return AsBaseUnitVolts().Equals(((ElectricPotential) obj).AsBaseUnitVolts()); + var objQuantity = (ElectricPotential)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -585,9 +584,10 @@ public bool Equals(ElectricPotential other, double tolerance, ComparisonType com /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(ElectricPotential, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(ElectricPotential other, ElectricPotential maxError) { - return Math.Abs(AsBaseUnitVolts() - other.AsBaseUnitVolts()) <= maxError.AsBaseUnitVolts(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -978,7 +978,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitVolts() { - if (Unit == ElectricPotentialUnit.Volt) { return _value; } + if (Unit == ElectricPotentialUnit.Volt) { return _value; } switch (Unit) { @@ -989,10 +989,10 @@ private double AsBaseUnitVolts() case ElectricPotentialUnit.Volt: return _value; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(ElectricPotentialUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.g.cs index c082eb396a..b8bcc27b7e 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.g.cs @@ -500,14 +500,14 @@ int CompareTo(ElectricPotentialAc other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(ElectricPotentialAc left, ElectricPotentialAc right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(ElectricPotentialAc left, ElectricPotentialAc right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -515,15 +515,14 @@ int CompareTo(ElectricPotentialAc other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is ElectricPotentialAc)) return false; - } - return AsBaseUnitVoltsAc().Equals(((ElectricPotentialAc) obj).AsBaseUnitVoltsAc()); + var objQuantity = (ElectricPotentialAc)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -585,9 +584,10 @@ public bool Equals(ElectricPotentialAc other, double tolerance, ComparisonType c /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(ElectricPotentialAc, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(ElectricPotentialAc other, ElectricPotentialAc maxError) { - return Math.Abs(AsBaseUnitVoltsAc() - other.AsBaseUnitVoltsAc()) <= maxError.AsBaseUnitVoltsAc(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -978,7 +978,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitVoltsAc() { - if (Unit == ElectricPotentialAcUnit.VoltAc) { return _value; } + if (Unit == ElectricPotentialAcUnit.VoltAc) { return _value; } switch (Unit) { @@ -989,10 +989,10 @@ private double AsBaseUnitVoltsAc() case ElectricPotentialAcUnit.VoltAc: return _value; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(ElectricPotentialAcUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.g.cs index cbd286bbcd..565acb5866 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.g.cs @@ -500,14 +500,14 @@ int CompareTo(ElectricPotentialDc other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(ElectricPotentialDc left, ElectricPotentialDc right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(ElectricPotentialDc left, ElectricPotentialDc right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -515,15 +515,14 @@ int CompareTo(ElectricPotentialDc other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is ElectricPotentialDc)) return false; - } - return AsBaseUnitVoltsDc().Equals(((ElectricPotentialDc) obj).AsBaseUnitVoltsDc()); + var objQuantity = (ElectricPotentialDc)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -585,9 +584,10 @@ public bool Equals(ElectricPotentialDc other, double tolerance, ComparisonType c /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(ElectricPotentialDc, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(ElectricPotentialDc other, ElectricPotentialDc maxError) { - return Math.Abs(AsBaseUnitVoltsDc() - other.AsBaseUnitVoltsDc()) <= maxError.AsBaseUnitVoltsDc(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -978,7 +978,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitVoltsDc() { - if (Unit == ElectricPotentialDcUnit.VoltDc) { return _value; } + if (Unit == ElectricPotentialDcUnit.VoltDc) { return _value; } switch (Unit) { @@ -989,10 +989,10 @@ private double AsBaseUnitVoltsDc() case ElectricPotentialDcUnit.VoltDc: return _value; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(ElectricPotentialDcUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs index 7af07329c3..ae59ef3509 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs @@ -467,14 +467,14 @@ int CompareTo(ElectricResistance other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(ElectricResistance left, ElectricResistance right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(ElectricResistance left, ElectricResistance right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -482,15 +482,14 @@ int CompareTo(ElectricResistance other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is ElectricResistance)) return false; - } - return AsBaseUnitOhms().Equals(((ElectricResistance) obj).AsBaseUnitOhms()); + var objQuantity = (ElectricResistance)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -552,9 +551,10 @@ public bool Equals(ElectricResistance other, double tolerance, ComparisonType co /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(ElectricResistance, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(ElectricResistance other, ElectricResistance maxError) { - return Math.Abs(AsBaseUnitOhms() - other.AsBaseUnitOhms()) <= maxError.AsBaseUnitOhms(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -944,7 +944,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitOhms() { - if (Unit == ElectricResistanceUnit.Ohm) { return _value; } + if (Unit == ElectricResistanceUnit.Ohm) { return _value; } switch (Unit) { @@ -954,10 +954,10 @@ private double AsBaseUnitOhms() case ElectricResistanceUnit.Ohm: return _value; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(ElectricResistanceUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs index b5ed6dc0be..c29cdfe547 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs @@ -467,14 +467,14 @@ int CompareTo(ElectricResistivity other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(ElectricResistivity left, ElectricResistivity right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(ElectricResistivity left, ElectricResistivity right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -482,15 +482,14 @@ int CompareTo(ElectricResistivity other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is ElectricResistivity)) return false; - } - return AsBaseUnitOhmMeters().Equals(((ElectricResistivity) obj).AsBaseUnitOhmMeters()); + var objQuantity = (ElectricResistivity)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -552,9 +551,10 @@ public bool Equals(ElectricResistivity other, double tolerance, ComparisonType c /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(ElectricResistivity, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(ElectricResistivity other, ElectricResistivity maxError) { - return Math.Abs(AsBaseUnitOhmMeters() - other.AsBaseUnitOhmMeters()) <= maxError.AsBaseUnitOhmMeters(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -944,7 +944,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitOhmMeters() { - if (Unit == ElectricResistivityUnit.OhmMeter) { return _value; } + if (Unit == ElectricResistivityUnit.OhmMeter) { return _value; } switch (Unit) { @@ -954,10 +954,10 @@ private double AsBaseUnitOhmMeters() case ElectricResistivityUnit.OhmMeter: return _value; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(ElectricResistivityUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/Energy.g.cs b/UnitsNet/GeneratedCode/Quantities/Energy.g.cs index afb21b38c9..cb97875094 100644 --- a/UnitsNet/GeneratedCode/Quantities/Energy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Energy.g.cs @@ -1061,14 +1061,14 @@ int CompareTo(Energy other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(Energy left, Energy right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(Energy left, Energy right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -1076,15 +1076,14 @@ int CompareTo(Energy other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is Energy)) return false; - } - return AsBaseUnitJoules().Equals(((Energy) obj).AsBaseUnitJoules()); + var objQuantity = (Energy)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -1146,9 +1145,10 @@ public bool Equals(Energy other, double tolerance, ComparisonType comparisonType /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(Energy, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(Energy other, Energy maxError) { - return Math.Abs(AsBaseUnitJoules() - other.AsBaseUnitJoules()) <= maxError.AsBaseUnitJoules(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -1556,7 +1556,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitJoules() { - if (Unit == EnergyUnit.Joule) { return _value; } + if (Unit == EnergyUnit.Joule) { return _value; } switch (Unit) { @@ -1584,10 +1584,10 @@ private double AsBaseUnitJoules() case EnergyUnit.WattHour: return _value*3600d; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(EnergyUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs b/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs index c1fe08ecb6..abc96664d8 100644 --- a/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs @@ -566,14 +566,14 @@ int CompareTo(Entropy other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(Entropy left, Entropy right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(Entropy left, Entropy right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -581,15 +581,14 @@ int CompareTo(Entropy other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is Entropy)) return false; - } - return AsBaseUnitJoulesPerKelvin().Equals(((Entropy) obj).AsBaseUnitJoulesPerKelvin()); + var objQuantity = (Entropy)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -651,9 +650,10 @@ public bool Equals(Entropy other, double tolerance, ComparisonType comparisonTyp /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(Entropy, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(Entropy other, Entropy maxError) { - return Math.Abs(AsBaseUnitJoulesPerKelvin() - other.AsBaseUnitJoulesPerKelvin()) <= maxError.AsBaseUnitJoulesPerKelvin(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -1046,7 +1046,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitJoulesPerKelvin() { - if (Unit == EntropyUnit.JoulePerKelvin) { return _value; } + if (Unit == EntropyUnit.JoulePerKelvin) { return _value; } switch (Unit) { @@ -1059,10 +1059,10 @@ private double AsBaseUnitJoulesPerKelvin() case EntropyUnit.MegajoulePerKelvin: return (_value) * 1e6d; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(EntropyUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/Flow.g.cs b/UnitsNet/GeneratedCode/Quantities/Flow.g.cs index 24905442eb..9a2b99564c 100644 --- a/UnitsNet/GeneratedCode/Quantities/Flow.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Flow.g.cs @@ -1145,14 +1145,14 @@ int CompareTo(Flow other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(Flow left, Flow right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(Flow left, Flow right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -1160,15 +1160,14 @@ int CompareTo(Flow other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is Flow)) return false; - } - return AsBaseUnitCubicMetersPerSecond().Equals(((Flow) obj).AsBaseUnitCubicMetersPerSecond()); + var objQuantity = (Flow)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -1230,9 +1229,10 @@ public bool Equals(Flow other, double tolerance, ComparisonType comparisonType) /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(Flow, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(Flow other, Flow maxError) { - return Math.Abs(AsBaseUnitCubicMetersPerSecond() - other.AsBaseUnitCubicMetersPerSecond()) <= maxError.AsBaseUnitCubicMetersPerSecond(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -1642,7 +1642,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitCubicMetersPerSecond() { - if (Unit == FlowUnit.CubicMeterPerSecond) { return _value; } + if (Unit == FlowUnit.CubicMeterPerSecond) { return _value; } switch (Unit) { @@ -1672,10 +1672,10 @@ private double AsBaseUnitCubicMetersPerSecond() case FlowUnit.UsGallonsPerSecond: return _value/264.1720523581484; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(FlowUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/Force.g.cs b/UnitsNet/GeneratedCode/Quantities/Force.g.cs index 25f12a30dd..cbc1145a45 100644 --- a/UnitsNet/GeneratedCode/Quantities/Force.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Force.g.cs @@ -665,14 +665,14 @@ int CompareTo(Force other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(Force left, Force right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(Force left, Force right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -680,15 +680,14 @@ int CompareTo(Force other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is Force)) return false; - } - return AsBaseUnitNewtons().Equals(((Force) obj).AsBaseUnitNewtons()); + var objQuantity = (Force)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -750,9 +749,10 @@ public bool Equals(Force other, double tolerance, ComparisonType comparisonType) /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(Force, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(Force other, Force maxError) { - return Math.Abs(AsBaseUnitNewtons() - other.AsBaseUnitNewtons()) <= maxError.AsBaseUnitNewtons(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -1148,7 +1148,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitNewtons() { - if (Unit == ForceUnit.Newton) { return _value; } + if (Unit == ForceUnit.Newton) { return _value; } switch (Unit) { @@ -1164,10 +1164,10 @@ private double AsBaseUnitNewtons() case ForceUnit.TonneForce: return _value*9.80665002864e3; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(ForceUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs index ff0f1139fc..906de10fd1 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs @@ -698,14 +698,14 @@ int CompareTo(ForceChangeRate other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(ForceChangeRate left, ForceChangeRate right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(ForceChangeRate left, ForceChangeRate right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -713,15 +713,14 @@ int CompareTo(ForceChangeRate other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is ForceChangeRate)) return false; - } - return AsBaseUnitNewtonsPerSecond().Equals(((ForceChangeRate) obj).AsBaseUnitNewtonsPerSecond()); + var objQuantity = (ForceChangeRate)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -783,9 +782,10 @@ public bool Equals(ForceChangeRate other, double tolerance, ComparisonType compa /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(ForceChangeRate, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(ForceChangeRate other, ForceChangeRate maxError) { - return Math.Abs(AsBaseUnitNewtonsPerSecond() - other.AsBaseUnitNewtonsPerSecond()) <= maxError.AsBaseUnitNewtonsPerSecond(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -1182,7 +1182,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitNewtonsPerSecond() { - if (Unit == ForceChangeRateUnit.NewtonPerSecond) { return _value; } + if (Unit == ForceChangeRateUnit.NewtonPerSecond) { return _value; } switch (Unit) { @@ -1199,10 +1199,10 @@ private double AsBaseUnitNewtonsPerSecond() case ForceChangeRateUnit.NewtonPerSecond: return _value; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(ForceChangeRateUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs index 9b4556c76a..23be6b51b8 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs @@ -632,14 +632,14 @@ int CompareTo(ForcePerLength other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(ForcePerLength left, ForcePerLength right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(ForcePerLength left, ForcePerLength right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -647,15 +647,14 @@ int CompareTo(ForcePerLength other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is ForcePerLength)) return false; - } - return AsBaseUnitNewtonsPerMeter().Equals(((ForcePerLength) obj).AsBaseUnitNewtonsPerMeter()); + var objQuantity = (ForcePerLength)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -717,9 +716,10 @@ public bool Equals(ForcePerLength other, double tolerance, ComparisonType compar /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(ForcePerLength, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(ForcePerLength other, ForcePerLength maxError) { - return Math.Abs(AsBaseUnitNewtonsPerMeter() - other.AsBaseUnitNewtonsPerMeter()) <= maxError.AsBaseUnitNewtonsPerMeter(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -1114,7 +1114,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitNewtonsPerMeter() { - if (Unit == ForcePerLengthUnit.NewtonPerMeter) { return _value; } + if (Unit == ForcePerLengthUnit.NewtonPerMeter) { return _value; } switch (Unit) { @@ -1129,10 +1129,10 @@ private double AsBaseUnitNewtonsPerMeter() case ForcePerLengthUnit.NewtonPerMeter: return _value; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(ForcePerLengthUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs b/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs index 63b22a0182..4d0e48b84b 100644 --- a/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs @@ -599,14 +599,14 @@ int CompareTo(Frequency other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(Frequency left, Frequency right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(Frequency left, Frequency right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -614,15 +614,14 @@ int CompareTo(Frequency other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is Frequency)) return false; - } - return AsBaseUnitHertz().Equals(((Frequency) obj).AsBaseUnitHertz()); + var objQuantity = (Frequency)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -684,9 +683,10 @@ public bool Equals(Frequency other, double tolerance, ComparisonType comparisonT /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(Frequency, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(Frequency other, Frequency maxError) { - return Math.Abs(AsBaseUnitHertz() - other.AsBaseUnitHertz()) <= maxError.AsBaseUnitHertz(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -1080,7 +1080,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitHertz() { - if (Unit == FrequencyUnit.Hertz) { return _value; } + if (Unit == FrequencyUnit.Hertz) { return _value; } switch (Unit) { @@ -1094,10 +1094,10 @@ private double AsBaseUnitHertz() case FrequencyUnit.Terahertz: return (_value) * 1e12d; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(FrequencyUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs index 3e3de5cf0d..c1fc683eef 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs @@ -863,14 +863,14 @@ int CompareTo(HeatFlux other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(HeatFlux left, HeatFlux right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(HeatFlux left, HeatFlux right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -878,15 +878,14 @@ int CompareTo(HeatFlux other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is HeatFlux)) return false; - } - return AsBaseUnitWattsPerSquareMeter().Equals(((HeatFlux) obj).AsBaseUnitWattsPerSquareMeter()); + var objQuantity = (HeatFlux)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -948,9 +947,10 @@ public bool Equals(HeatFlux other, double tolerance, ComparisonType comparisonTy /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(HeatFlux, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(HeatFlux other, HeatFlux maxError) { - return Math.Abs(AsBaseUnitWattsPerSquareMeter() - other.AsBaseUnitWattsPerSquareMeter()) <= maxError.AsBaseUnitWattsPerSquareMeter(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -1352,7 +1352,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitWattsPerSquareMeter() { - if (Unit == HeatFluxUnit.WattPerSquareMeter) { return _value; } + if (Unit == HeatFluxUnit.WattPerSquareMeter) { return _value; } switch (Unit) { @@ -1374,10 +1374,10 @@ private double AsBaseUnitWattsPerSquareMeter() case HeatFluxUnit.WattPerSquareMeter: return _value; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(HeatFluxUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs index 11bb29e292..83fe03020b 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs @@ -401,14 +401,14 @@ int CompareTo(HeatTransferCoefficient other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(HeatTransferCoefficient left, HeatTransferCoefficient right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(HeatTransferCoefficient left, HeatTransferCoefficient right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -416,15 +416,14 @@ int CompareTo(HeatTransferCoefficient other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is HeatTransferCoefficient)) return false; - } - return AsBaseUnitWattsPerSquareMeterKelvin().Equals(((HeatTransferCoefficient) obj).AsBaseUnitWattsPerSquareMeterKelvin()); + var objQuantity = (HeatTransferCoefficient)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -486,9 +485,10 @@ public bool Equals(HeatTransferCoefficient other, double tolerance, ComparisonTy /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(HeatTransferCoefficient, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(HeatTransferCoefficient other, HeatTransferCoefficient maxError) { - return Math.Abs(AsBaseUnitWattsPerSquareMeterKelvin() - other.AsBaseUnitWattsPerSquareMeterKelvin()) <= maxError.AsBaseUnitWattsPerSquareMeterKelvin(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -876,7 +876,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitWattsPerSquareMeterKelvin() { - if (Unit == HeatTransferCoefficientUnit.WattPerSquareMeterKelvin) { return _value; } + if (Unit == HeatTransferCoefficientUnit.WattPerSquareMeterKelvin) { return _value; } switch (Unit) { @@ -884,10 +884,10 @@ private double AsBaseUnitWattsPerSquareMeterKelvin() case HeatTransferCoefficientUnit.WattPerSquareMeterKelvin: return _value; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(HeatTransferCoefficientUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs b/UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs index f1f3d16a34..2b9feffce2 100644 --- a/UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs @@ -467,14 +467,14 @@ int CompareTo(Illuminance other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(Illuminance left, Illuminance right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(Illuminance left, Illuminance right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -482,15 +482,14 @@ int CompareTo(Illuminance other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is Illuminance)) return false; - } - return AsBaseUnitLux().Equals(((Illuminance) obj).AsBaseUnitLux()); + var objQuantity = (Illuminance)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -552,9 +551,10 @@ public bool Equals(Illuminance other, double tolerance, ComparisonType compariso /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(Illuminance, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(Illuminance other, Illuminance maxError) { - return Math.Abs(AsBaseUnitLux() - other.AsBaseUnitLux()) <= maxError.AsBaseUnitLux(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -944,7 +944,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitLux() { - if (Unit == IlluminanceUnit.Lux) { return _value; } + if (Unit == IlluminanceUnit.Lux) { return _value; } switch (Unit) { @@ -954,10 +954,10 @@ private double AsBaseUnitLux() case IlluminanceUnit.Millilux: return (_value) * 1e-3d; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(IlluminanceUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/Information.g.cs b/UnitsNet/GeneratedCode/Quantities/Information.g.cs index 3ad4a76c2e..b42337c30c 100644 --- a/UnitsNet/GeneratedCode/Quantities/Information.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Information.g.cs @@ -1208,12 +1208,11 @@ int CompareTo(Information other) public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is Information)) return false; - } - return AsBaseUnitBits().Equals(((Information) obj).AsBaseUnitBits()); + var objQuantity = (Information)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -1275,9 +1274,10 @@ public bool Equals(Information other, double tolerance, ComparisonType compariso /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(Information, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(Information other, Information maxError) { - return Math.Abs(AsBaseUnitBits() - other.AsBaseUnitBits()) <= maxError.AsBaseUnitBits(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -1689,7 +1689,7 @@ public string ToString( /// The value in the base unit representation. private decimal AsBaseUnitBits() { - if (Unit == InformationUnit.Bit) { return _value; } + if (Unit == InformationUnit.Bit) { return _value; } switch (Unit) { @@ -1721,10 +1721,10 @@ private decimal AsBaseUnitBits() case InformationUnit.Terabyte: return Convert.ToDecimal((_value*8m) * 1e12m); default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private decimal AsBaseNumericType(InformationUnit unit) => Convert.ToDecimal(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs index 5a552d1219..dd3cf49373 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs @@ -401,14 +401,14 @@ int CompareTo(Irradiance other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(Irradiance left, Irradiance right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(Irradiance left, Irradiance right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -416,15 +416,14 @@ int CompareTo(Irradiance other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is Irradiance)) return false; - } - return AsBaseUnitWattsPerSquareMeter().Equals(((Irradiance) obj).AsBaseUnitWattsPerSquareMeter()); + var objQuantity = (Irradiance)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -486,9 +485,10 @@ public bool Equals(Irradiance other, double tolerance, ComparisonType comparison /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(Irradiance, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(Irradiance other, Irradiance maxError) { - return Math.Abs(AsBaseUnitWattsPerSquareMeter() - other.AsBaseUnitWattsPerSquareMeter()) <= maxError.AsBaseUnitWattsPerSquareMeter(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -876,7 +876,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitWattsPerSquareMeter() { - if (Unit == IrradianceUnit.WattPerSquareMeter) { return _value; } + if (Unit == IrradianceUnit.WattPerSquareMeter) { return _value; } switch (Unit) { @@ -884,10 +884,10 @@ private double AsBaseUnitWattsPerSquareMeter() case IrradianceUnit.WattPerSquareMeter: return _value; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(IrradianceUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs index ca64535e94..95a66b5b17 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs @@ -434,14 +434,14 @@ int CompareTo(Irradiation other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(Irradiation left, Irradiation right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(Irradiation left, Irradiation right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -449,15 +449,14 @@ int CompareTo(Irradiation other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is Irradiation)) return false; - } - return AsBaseUnitJoulesPerSquareMeter().Equals(((Irradiation) obj).AsBaseUnitJoulesPerSquareMeter()); + var objQuantity = (Irradiation)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -519,9 +518,10 @@ public bool Equals(Irradiation other, double tolerance, ComparisonType compariso /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(Irradiation, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(Irradiation other, Irradiation maxError) { - return Math.Abs(AsBaseUnitJoulesPerSquareMeter() - other.AsBaseUnitJoulesPerSquareMeter()) <= maxError.AsBaseUnitJoulesPerSquareMeter(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -910,7 +910,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitJoulesPerSquareMeter() { - if (Unit == IrradiationUnit.JoulePerSquareMeter) { return _value; } + if (Unit == IrradiationUnit.JoulePerSquareMeter) { return _value; } switch (Unit) { @@ -919,10 +919,10 @@ private double AsBaseUnitJoulesPerSquareMeter() case IrradiationUnit.WattHourPerSquareMeter: return _value*3600d; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(IrradiationUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs index 0194f2bf4f..d134997017 100644 --- a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs @@ -599,14 +599,14 @@ int CompareTo(KinematicViscosity other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(KinematicViscosity left, KinematicViscosity right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(KinematicViscosity left, KinematicViscosity right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -614,15 +614,14 @@ int CompareTo(KinematicViscosity other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is KinematicViscosity)) return false; - } - return AsBaseUnitSquareMetersPerSecond().Equals(((KinematicViscosity) obj).AsBaseUnitSquareMetersPerSecond()); + var objQuantity = (KinematicViscosity)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -684,9 +683,10 @@ public bool Equals(KinematicViscosity other, double tolerance, ComparisonType co /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(KinematicViscosity, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(KinematicViscosity other, KinematicViscosity maxError) { - return Math.Abs(AsBaseUnitSquareMetersPerSecond() - other.AsBaseUnitSquareMetersPerSecond()) <= maxError.AsBaseUnitSquareMetersPerSecond(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -1080,7 +1080,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitSquareMetersPerSecond() { - if (Unit == KinematicViscosityUnit.SquareMeterPerSecond) { return _value; } + if (Unit == KinematicViscosityUnit.SquareMeterPerSecond) { return _value; } switch (Unit) { @@ -1094,10 +1094,10 @@ private double AsBaseUnitSquareMetersPerSecond() case KinematicViscosityUnit.Stokes: return _value/1e4; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(KinematicViscosityUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/LapseRate.g.cs b/UnitsNet/GeneratedCode/Quantities/LapseRate.g.cs index d609d4724f..98ad43721a 100644 --- a/UnitsNet/GeneratedCode/Quantities/LapseRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LapseRate.g.cs @@ -368,14 +368,14 @@ int CompareTo(LapseRate other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(LapseRate left, LapseRate right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(LapseRate left, LapseRate right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -383,15 +383,14 @@ int CompareTo(LapseRate other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is LapseRate)) return false; - } - return AsBaseUnitDegreesCelciusPerKilometer().Equals(((LapseRate) obj).AsBaseUnitDegreesCelciusPerKilometer()); + var objQuantity = (LapseRate)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -453,9 +452,10 @@ public bool Equals(LapseRate other, double tolerance, ComparisonType comparisonT /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(LapseRate, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(LapseRate other, LapseRate maxError) { - return Math.Abs(AsBaseUnitDegreesCelciusPerKilometer() - other.AsBaseUnitDegreesCelciusPerKilometer()) <= maxError.AsBaseUnitDegreesCelciusPerKilometer(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -842,17 +842,17 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitDegreesCelciusPerKilometer() { - if (Unit == LapseRateUnit.DegreeCelsiusPerKilometer) { return _value; } + if (Unit == LapseRateUnit.DegreeCelsiusPerKilometer) { return _value; } switch (Unit) { case LapseRateUnit.DegreeCelsiusPerKilometer: return _value; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(LapseRateUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/Length.g.cs b/UnitsNet/GeneratedCode/Quantities/Length.g.cs index a2565600c9..f1901c44fc 100644 --- a/UnitsNet/GeneratedCode/Quantities/Length.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Length.g.cs @@ -1061,14 +1061,14 @@ int CompareTo(Length other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(Length left, Length right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(Length left, Length right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -1076,15 +1076,14 @@ int CompareTo(Length other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is Length)) return false; - } - return AsBaseUnitMeters().Equals(((Length) obj).AsBaseUnitMeters()); + var objQuantity = (Length)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -1146,9 +1145,10 @@ public bool Equals(Length other, double tolerance, ComparisonType comparisonType /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(Length, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(Length other, Length maxError) { - return Math.Abs(AsBaseUnitMeters() - other.AsBaseUnitMeters()) <= maxError.AsBaseUnitMeters(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -1556,7 +1556,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitMeters() { - if (Unit == LengthUnit.Meter) { return _value; } + if (Unit == LengthUnit.Meter) { return _value; } switch (Unit) { @@ -1584,10 +1584,10 @@ private double AsBaseUnitMeters() case LengthUnit.Yard: return _value*0.9144; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(LengthUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/Level.g.cs b/UnitsNet/GeneratedCode/Quantities/Level.g.cs index 2996c6b667..66c667dadc 100644 --- a/UnitsNet/GeneratedCode/Quantities/Level.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Level.g.cs @@ -409,14 +409,14 @@ int CompareTo(Level other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(Level left, Level right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(Level left, Level right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -424,15 +424,14 @@ int CompareTo(Level other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is Level)) return false; - } - return AsBaseUnitDecibels().Equals(((Level) obj).AsBaseUnitDecibels()); + var objQuantity = (Level)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -494,9 +493,10 @@ public bool Equals(Level other, double tolerance, ComparisonType comparisonType) /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(Level, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(Level other, Level maxError) { - return Math.Abs(AsBaseUnitDecibels() - other.AsBaseUnitDecibels()) <= maxError.AsBaseUnitDecibels(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -884,7 +884,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitDecibels() { - if (Unit == LevelUnit.Decibel) { return _value; } + if (Unit == LevelUnit.Decibel) { return _value; } switch (Unit) { @@ -892,10 +892,10 @@ private double AsBaseUnitDecibels() case LevelUnit.Neper: return (1/0.115129254)*_value; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(LevelUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs index 914886e7b2..85fe2eaf97 100644 --- a/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs @@ -434,14 +434,14 @@ int CompareTo(LinearDensity other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(LinearDensity left, LinearDensity right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(LinearDensity left, LinearDensity right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -449,15 +449,14 @@ int CompareTo(LinearDensity other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is LinearDensity)) return false; - } - return AsBaseUnitKilogramsPerMeter().Equals(((LinearDensity) obj).AsBaseUnitKilogramsPerMeter()); + var objQuantity = (LinearDensity)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -519,9 +518,10 @@ public bool Equals(LinearDensity other, double tolerance, ComparisonType compari /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(LinearDensity, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(LinearDensity other, LinearDensity maxError) { - return Math.Abs(AsBaseUnitKilogramsPerMeter() - other.AsBaseUnitKilogramsPerMeter()) <= maxError.AsBaseUnitKilogramsPerMeter(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -910,7 +910,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitKilogramsPerMeter() { - if (Unit == LinearDensityUnit.KilogramPerMeter) { return _value; } + if (Unit == LinearDensityUnit.KilogramPerMeter) { return _value; } switch (Unit) { @@ -919,10 +919,10 @@ private double AsBaseUnitKilogramsPerMeter() case LinearDensityUnit.PoundPerFoot: return _value*1.48816394; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(LinearDensityUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.g.cs index b4d7a9863d..5c8a1a9f79 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.g.cs @@ -368,14 +368,14 @@ int CompareTo(LuminousFlux other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(LuminousFlux left, LuminousFlux right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(LuminousFlux left, LuminousFlux right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -383,15 +383,14 @@ int CompareTo(LuminousFlux other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is LuminousFlux)) return false; - } - return AsBaseUnitLumens().Equals(((LuminousFlux) obj).AsBaseUnitLumens()); + var objQuantity = (LuminousFlux)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -453,9 +452,10 @@ public bool Equals(LuminousFlux other, double tolerance, ComparisonType comparis /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(LuminousFlux, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(LuminousFlux other, LuminousFlux maxError) { - return Math.Abs(AsBaseUnitLumens() - other.AsBaseUnitLumens()) <= maxError.AsBaseUnitLumens(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -842,17 +842,17 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitLumens() { - if (Unit == LuminousFluxUnit.Lumen) { return _value; } + if (Unit == LuminousFluxUnit.Lumen) { return _value; } switch (Unit) { case LuminousFluxUnit.Lumen: return _value; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(LuminousFluxUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs index 486fbf379b..83e4bfc86c 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs @@ -368,14 +368,14 @@ int CompareTo(LuminousIntensity other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(LuminousIntensity left, LuminousIntensity right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(LuminousIntensity left, LuminousIntensity right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -383,15 +383,14 @@ int CompareTo(LuminousIntensity other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is LuminousIntensity)) return false; - } - return AsBaseUnitCandela().Equals(((LuminousIntensity) obj).AsBaseUnitCandela()); + var objQuantity = (LuminousIntensity)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -453,9 +452,10 @@ public bool Equals(LuminousIntensity other, double tolerance, ComparisonType com /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(LuminousIntensity, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(LuminousIntensity other, LuminousIntensity maxError) { - return Math.Abs(AsBaseUnitCandela() - other.AsBaseUnitCandela()) <= maxError.AsBaseUnitCandela(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -842,17 +842,17 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitCandela() { - if (Unit == LuminousIntensityUnit.Candela) { return _value; } + if (Unit == LuminousIntensityUnit.Candela) { return _value; } switch (Unit) { case LuminousIntensityUnit.Candela: return _value; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(LuminousIntensityUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticField.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticField.g.cs index 5dbab4d363..d4fb2dd70f 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticField.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticField.g.cs @@ -368,14 +368,14 @@ int CompareTo(MagneticField other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(MagneticField left, MagneticField right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(MagneticField left, MagneticField right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -383,15 +383,14 @@ int CompareTo(MagneticField other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is MagneticField)) return false; - } - return AsBaseUnitTeslas().Equals(((MagneticField) obj).AsBaseUnitTeslas()); + var objQuantity = (MagneticField)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -453,9 +452,10 @@ public bool Equals(MagneticField other, double tolerance, ComparisonType compari /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(MagneticField, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(MagneticField other, MagneticField maxError) { - return Math.Abs(AsBaseUnitTeslas() - other.AsBaseUnitTeslas()) <= maxError.AsBaseUnitTeslas(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -842,17 +842,17 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitTeslas() { - if (Unit == MagneticFieldUnit.Tesla) { return _value; } + if (Unit == MagneticFieldUnit.Tesla) { return _value; } switch (Unit) { case MagneticFieldUnit.Tesla: return _value; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(MagneticFieldUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.g.cs index cf729ca245..fff5862c1d 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.g.cs @@ -368,14 +368,14 @@ int CompareTo(MagneticFlux other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(MagneticFlux left, MagneticFlux right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(MagneticFlux left, MagneticFlux right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -383,15 +383,14 @@ int CompareTo(MagneticFlux other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is MagneticFlux)) return false; - } - return AsBaseUnitWebers().Equals(((MagneticFlux) obj).AsBaseUnitWebers()); + var objQuantity = (MagneticFlux)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -453,9 +452,10 @@ public bool Equals(MagneticFlux other, double tolerance, ComparisonType comparis /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(MagneticFlux, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(MagneticFlux other, MagneticFlux maxError) { - return Math.Abs(AsBaseUnitWebers() - other.AsBaseUnitWebers()) <= maxError.AsBaseUnitWebers(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -842,17 +842,17 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitWebers() { - if (Unit == MagneticFluxUnit.Weber) { return _value; } + if (Unit == MagneticFluxUnit.Weber) { return _value; } switch (Unit) { case MagneticFluxUnit.Weber: return _value; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(MagneticFluxUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/Magnetization.g.cs b/UnitsNet/GeneratedCode/Quantities/Magnetization.g.cs index dc23a56ae0..4b9694bdb3 100644 --- a/UnitsNet/GeneratedCode/Quantities/Magnetization.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Magnetization.g.cs @@ -368,14 +368,14 @@ int CompareTo(Magnetization other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(Magnetization left, Magnetization right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(Magnetization left, Magnetization right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -383,15 +383,14 @@ int CompareTo(Magnetization other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is Magnetization)) return false; - } - return AsBaseUnitAmperesPerMeter().Equals(((Magnetization) obj).AsBaseUnitAmperesPerMeter()); + var objQuantity = (Magnetization)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -453,9 +452,10 @@ public bool Equals(Magnetization other, double tolerance, ComparisonType compari /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(Magnetization, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(Magnetization other, Magnetization maxError) { - return Math.Abs(AsBaseUnitAmperesPerMeter() - other.AsBaseUnitAmperesPerMeter()) <= maxError.AsBaseUnitAmperesPerMeter(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -842,17 +842,17 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitAmperesPerMeter() { - if (Unit == MagnetizationUnit.AmperePerMeter) { return _value; } + if (Unit == MagnetizationUnit.AmperePerMeter) { return _value; } switch (Unit) { case MagnetizationUnit.AmperePerMeter: return _value; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(MagnetizationUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/Mass.g.cs b/UnitsNet/GeneratedCode/Quantities/Mass.g.cs index 0470164ed1..91af77f512 100644 --- a/UnitsNet/GeneratedCode/Quantities/Mass.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Mass.g.cs @@ -1028,14 +1028,14 @@ int CompareTo(Mass other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(Mass left, Mass right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(Mass left, Mass right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -1043,15 +1043,14 @@ int CompareTo(Mass other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is Mass)) return false; - } - return AsBaseUnitKilograms().Equals(((Mass) obj).AsBaseUnitKilograms()); + var objQuantity = (Mass)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -1113,9 +1112,10 @@ public bool Equals(Mass other, double tolerance, ComparisonType comparisonType) /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(Mass, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(Mass other, Mass maxError) { - return Math.Abs(AsBaseUnitKilograms() - other.AsBaseUnitKilograms()) <= maxError.AsBaseUnitKilograms(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -1522,7 +1522,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitKilograms() { - if (Unit == MassUnit.Kilogram) { return _value; } + if (Unit == MassUnit.Kilogram) { return _value; } switch (Unit) { @@ -1549,10 +1549,10 @@ private double AsBaseUnitKilograms() case MassUnit.Tonne: return _value*1e3; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(MassUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs index 8b5d0f96f8..be3dabd30c 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs @@ -830,14 +830,14 @@ int CompareTo(MassFlow other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(MassFlow left, MassFlow right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(MassFlow left, MassFlow right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -845,15 +845,14 @@ int CompareTo(MassFlow other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is MassFlow)) return false; - } - return AsBaseUnitGramsPerSecond().Equals(((MassFlow) obj).AsBaseUnitGramsPerSecond()); + var objQuantity = (MassFlow)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -915,9 +914,10 @@ public bool Equals(MassFlow other, double tolerance, ComparisonType comparisonTy /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(MassFlow, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(MassFlow other, MassFlow maxError) { - return Math.Abs(AsBaseUnitGramsPerSecond() - other.AsBaseUnitGramsPerSecond()) <= maxError.AsBaseUnitGramsPerSecond(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -1318,7 +1318,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitGramsPerSecond() { - if (Unit == MassFlowUnit.GramPerSecond) { return _value; } + if (Unit == MassFlowUnit.GramPerSecond) { return _value; } switch (Unit) { @@ -1339,10 +1339,10 @@ private double AsBaseUnitGramsPerSecond() case MassFlowUnit.TonnePerHour: return 1000*_value/3.6; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(MassFlowUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs index f2eef98e11..34da85d5cb 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs @@ -401,14 +401,14 @@ int CompareTo(MassFlux other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(MassFlux left, MassFlux right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(MassFlux left, MassFlux right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -416,15 +416,14 @@ int CompareTo(MassFlux other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is MassFlux)) return false; - } - return AsBaseUnitKilogramsPerSecondPerSquareMeter().Equals(((MassFlux) obj).AsBaseUnitKilogramsPerSecondPerSquareMeter()); + var objQuantity = (MassFlux)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -486,9 +485,10 @@ public bool Equals(MassFlux other, double tolerance, ComparisonType comparisonTy /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(MassFlux, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(MassFlux other, MassFlux maxError) { - return Math.Abs(AsBaseUnitKilogramsPerSecondPerSquareMeter() - other.AsBaseUnitKilogramsPerSecondPerSquareMeter()) <= maxError.AsBaseUnitKilogramsPerSecondPerSquareMeter(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -876,7 +876,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitKilogramsPerSecondPerSquareMeter() { - if (Unit == MassFluxUnit.KilogramPerSecondPerSquareMeter) { return _value; } + if (Unit == MassFluxUnit.KilogramPerSecondPerSquareMeter) { return _value; } switch (Unit) { @@ -884,10 +884,10 @@ private double AsBaseUnitKilogramsPerSecondPerSquareMeter() case MassFluxUnit.KilogramPerSecondPerSquareMeter: return (_value/1e3) * 1e3d; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(MassFluxUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.g.cs b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.g.cs index b295a1f180..801b572c4a 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.g.cs @@ -1193,14 +1193,14 @@ int CompareTo(MassMomentOfInertia other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(MassMomentOfInertia left, MassMomentOfInertia right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(MassMomentOfInertia left, MassMomentOfInertia right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -1208,15 +1208,14 @@ int CompareTo(MassMomentOfInertia other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is MassMomentOfInertia)) return false; - } - return AsBaseUnitKilogramSquareMeters().Equals(((MassMomentOfInertia) obj).AsBaseUnitKilogramSquareMeters()); + var objQuantity = (MassMomentOfInertia)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -1278,9 +1277,10 @@ public bool Equals(MassMomentOfInertia other, double tolerance, ComparisonType c /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(MassMomentOfInertia, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(MassMomentOfInertia other, MassMomentOfInertia maxError) { - return Math.Abs(AsBaseUnitKilogramSquareMeters() - other.AsBaseUnitKilogramSquareMeters()) <= maxError.AsBaseUnitKilogramSquareMeters(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -1692,7 +1692,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitKilogramSquareMeters() { - if (Unit == MassMomentOfInertiaUnit.KilogramSquareMeter) { return _value; } + if (Unit == MassMomentOfInertiaUnit.KilogramSquareMeter) { return _value; } switch (Unit) { @@ -1724,10 +1724,10 @@ private double AsBaseUnitKilogramSquareMeters() case MassMomentOfInertiaUnit.TonneSquareMilimeter: return _value/1e3; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(MassMomentOfInertiaUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.g.cs index ebc5f35ec9..ffe06e1cab 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.g.cs @@ -434,14 +434,14 @@ int CompareTo(MolarEnergy other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(MolarEnergy left, MolarEnergy right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(MolarEnergy left, MolarEnergy right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -449,15 +449,14 @@ int CompareTo(MolarEnergy other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is MolarEnergy)) return false; - } - return AsBaseUnitJoulesPerMole().Equals(((MolarEnergy) obj).AsBaseUnitJoulesPerMole()); + var objQuantity = (MolarEnergy)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -519,9 +518,10 @@ public bool Equals(MolarEnergy other, double tolerance, ComparisonType compariso /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(MolarEnergy, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(MolarEnergy other, MolarEnergy maxError) { - return Math.Abs(AsBaseUnitJoulesPerMole() - other.AsBaseUnitJoulesPerMole()) <= maxError.AsBaseUnitJoulesPerMole(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -910,7 +910,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitJoulesPerMole() { - if (Unit == MolarEnergyUnit.JoulePerMole) { return _value; } + if (Unit == MolarEnergyUnit.JoulePerMole) { return _value; } switch (Unit) { @@ -919,10 +919,10 @@ private double AsBaseUnitJoulesPerMole() case MolarEnergyUnit.MegajoulePerMole: return (_value) * 1e6d; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(MolarEnergyUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.g.cs index 70e8aaf43c..1427c43980 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.g.cs @@ -434,14 +434,14 @@ int CompareTo(MolarEntropy other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(MolarEntropy left, MolarEntropy right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(MolarEntropy left, MolarEntropy right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -449,15 +449,14 @@ int CompareTo(MolarEntropy other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is MolarEntropy)) return false; - } - return AsBaseUnitJoulesPerMoleKelvin().Equals(((MolarEntropy) obj).AsBaseUnitJoulesPerMoleKelvin()); + var objQuantity = (MolarEntropy)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -519,9 +518,10 @@ public bool Equals(MolarEntropy other, double tolerance, ComparisonType comparis /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(MolarEntropy, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(MolarEntropy other, MolarEntropy maxError) { - return Math.Abs(AsBaseUnitJoulesPerMoleKelvin() - other.AsBaseUnitJoulesPerMoleKelvin()) <= maxError.AsBaseUnitJoulesPerMoleKelvin(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -910,7 +910,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitJoulesPerMoleKelvin() { - if (Unit == MolarEntropyUnit.JoulePerMoleKelvin) { return _value; } + if (Unit == MolarEntropyUnit.JoulePerMoleKelvin) { return _value; } switch (Unit) { @@ -919,10 +919,10 @@ private double AsBaseUnitJoulesPerMoleKelvin() case MolarEntropyUnit.MegajoulePerMoleKelvin: return (_value) * 1e6d; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(MolarEntropyUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs index 7e79239dca..30ba981fa1 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs @@ -731,14 +731,14 @@ int CompareTo(MolarMass other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(MolarMass left, MolarMass right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(MolarMass left, MolarMass right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -746,15 +746,14 @@ int CompareTo(MolarMass other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is MolarMass)) return false; - } - return AsBaseUnitKilogramsPerMole().Equals(((MolarMass) obj).AsBaseUnitKilogramsPerMole()); + var objQuantity = (MolarMass)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -816,9 +815,10 @@ public bool Equals(MolarMass other, double tolerance, ComparisonType comparisonT /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(MolarMass, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(MolarMass other, MolarMass maxError) { - return Math.Abs(AsBaseUnitKilogramsPerMole() - other.AsBaseUnitKilogramsPerMole()) <= maxError.AsBaseUnitKilogramsPerMole(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -1216,7 +1216,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitKilogramsPerMole() { - if (Unit == MolarMassUnit.KilogramPerMole) { return _value; } + if (Unit == MolarMassUnit.KilogramPerMole) { return _value; } switch (Unit) { @@ -1234,10 +1234,10 @@ private double AsBaseUnitKilogramsPerMole() case MolarMassUnit.PoundPerMole: return _value*0.45359237; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(MolarMassUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs b/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs index a67b08ce59..05024b1f25 100644 --- a/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs @@ -599,14 +599,14 @@ int CompareTo(Molarity other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(Molarity left, Molarity right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(Molarity left, Molarity right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -614,15 +614,14 @@ int CompareTo(Molarity other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is Molarity)) return false; - } - return AsBaseUnitMolesPerCubicMeter().Equals(((Molarity) obj).AsBaseUnitMolesPerCubicMeter()); + var objQuantity = (Molarity)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -684,9 +683,10 @@ public bool Equals(Molarity other, double tolerance, ComparisonType comparisonTy /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(Molarity, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(Molarity other, Molarity maxError) { - return Math.Abs(AsBaseUnitMolesPerCubicMeter() - other.AsBaseUnitMolesPerCubicMeter()) <= maxError.AsBaseUnitMolesPerCubicMeter(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -1080,7 +1080,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitMolesPerCubicMeter() { - if (Unit == MolarityUnit.MolesPerCubicMeter) { return _value; } + if (Unit == MolarityUnit.MolesPerCubicMeter) { return _value; } switch (Unit) { @@ -1094,10 +1094,10 @@ private double AsBaseUnitMolesPerCubicMeter() case MolarityUnit.PicomolesPerLiter: return (_value/1e-3) * 1e-12d; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(MolarityUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/Permeability.g.cs b/UnitsNet/GeneratedCode/Quantities/Permeability.g.cs index 38cba4794d..1868687f55 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permeability.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permeability.g.cs @@ -368,14 +368,14 @@ int CompareTo(Permeability other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(Permeability left, Permeability right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(Permeability left, Permeability right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -383,15 +383,14 @@ int CompareTo(Permeability other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is Permeability)) return false; - } - return AsBaseUnitHenriesPerMeter().Equals(((Permeability) obj).AsBaseUnitHenriesPerMeter()); + var objQuantity = (Permeability)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -453,9 +452,10 @@ public bool Equals(Permeability other, double tolerance, ComparisonType comparis /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(Permeability, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(Permeability other, Permeability maxError) { - return Math.Abs(AsBaseUnitHenriesPerMeter() - other.AsBaseUnitHenriesPerMeter()) <= maxError.AsBaseUnitHenriesPerMeter(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -842,17 +842,17 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitHenriesPerMeter() { - if (Unit == PermeabilityUnit.HenryPerMeter) { return _value; } + if (Unit == PermeabilityUnit.HenryPerMeter) { return _value; } switch (Unit) { case PermeabilityUnit.HenryPerMeter: return _value; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(PermeabilityUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/Permittivity.g.cs b/UnitsNet/GeneratedCode/Quantities/Permittivity.g.cs index eab90cb4ec..6c44e195bb 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permittivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permittivity.g.cs @@ -368,14 +368,14 @@ int CompareTo(Permittivity other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(Permittivity left, Permittivity right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(Permittivity left, Permittivity right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -383,15 +383,14 @@ int CompareTo(Permittivity other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is Permittivity)) return false; - } - return AsBaseUnitFaradsPerMeter().Equals(((Permittivity) obj).AsBaseUnitFaradsPerMeter()); + var objQuantity = (Permittivity)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -453,9 +452,10 @@ public bool Equals(Permittivity other, double tolerance, ComparisonType comparis /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(Permittivity, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(Permittivity other, Permittivity maxError) { - return Math.Abs(AsBaseUnitFaradsPerMeter() - other.AsBaseUnitFaradsPerMeter()) <= maxError.AsBaseUnitFaradsPerMeter(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -842,17 +842,17 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitFaradsPerMeter() { - if (Unit == PermittivityUnit.FaradPerMeter) { return _value; } + if (Unit == PermittivityUnit.FaradPerMeter) { return _value; } switch (Unit) { case PermittivityUnit.FaradPerMeter: return _value; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(PermittivityUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/Power.g.cs b/UnitsNet/GeneratedCode/Quantities/Power.g.cs index ae49a2c7c7..a6f26ec047 100644 --- a/UnitsNet/GeneratedCode/Quantities/Power.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Power.g.cs @@ -1010,12 +1010,11 @@ int CompareTo(Power other) public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is Power)) return false; - } - return AsBaseUnitWatts().Equals(((Power) obj).AsBaseUnitWatts()); + var objQuantity = (Power)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -1077,9 +1076,10 @@ public bool Equals(Power other, double tolerance, ComparisonType comparisonType) /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(Power, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(Power other, Power maxError) { - return Math.Abs(AsBaseUnitWatts() - other.AsBaseUnitWatts()) <= maxError.AsBaseUnitWatts(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -1485,7 +1485,7 @@ public string ToString( /// The value in the base unit representation. private decimal AsBaseUnitWatts() { - if (Unit == PowerUnit.Watt) { return _value; } + if (Unit == PowerUnit.Watt) { return _value; } switch (Unit) { @@ -1511,10 +1511,10 @@ private decimal AsBaseUnitWatts() case PowerUnit.Watt: return Convert.ToDecimal(_value); default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private decimal AsBaseNumericType(PowerUnit unit) => Convert.ToDecimal(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs index 5f39ca37cc..7c56244b9d 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs @@ -1787,14 +1787,14 @@ int CompareTo(PowerDensity other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(PowerDensity left, PowerDensity right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(PowerDensity left, PowerDensity right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -1802,15 +1802,14 @@ int CompareTo(PowerDensity other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is PowerDensity)) return false; - } - return AsBaseUnitWattsPerCubicMeter().Equals(((PowerDensity) obj).AsBaseUnitWattsPerCubicMeter()); + var objQuantity = (PowerDensity)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -1872,9 +1871,10 @@ public bool Equals(PowerDensity other, double tolerance, ComparisonType comparis /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(PowerDensity, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(PowerDensity other, PowerDensity maxError) { - return Math.Abs(AsBaseUnitWattsPerCubicMeter() - other.AsBaseUnitWattsPerCubicMeter()) <= maxError.AsBaseUnitWattsPerCubicMeter(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -2304,7 +2304,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitWattsPerCubicMeter() { - if (Unit == PowerDensityUnit.WattPerCubicMeter) { return _value; } + if (Unit == PowerDensityUnit.WattPerCubicMeter) { return _value; } switch (Unit) { @@ -2354,10 +2354,10 @@ private double AsBaseUnitWattsPerCubicMeter() case PowerDensityUnit.WattPerLiter: return _value*1.0e3; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(PowerDensityUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/PowerRatio.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerRatio.g.cs index c1a2a6cb9c..b69aac5539 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerRatio.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerRatio.g.cs @@ -409,14 +409,14 @@ int CompareTo(PowerRatio other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(PowerRatio left, PowerRatio right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(PowerRatio left, PowerRatio right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -424,15 +424,14 @@ int CompareTo(PowerRatio other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is PowerRatio)) return false; - } - return AsBaseUnitDecibelWatts().Equals(((PowerRatio) obj).AsBaseUnitDecibelWatts()); + var objQuantity = (PowerRatio)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -494,9 +493,10 @@ public bool Equals(PowerRatio other, double tolerance, ComparisonType comparison /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(PowerRatio, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(PowerRatio other, PowerRatio maxError) { - return Math.Abs(AsBaseUnitDecibelWatts() - other.AsBaseUnitDecibelWatts()) <= maxError.AsBaseUnitDecibelWatts(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -884,7 +884,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitDecibelWatts() { - if (Unit == PowerRatioUnit.DecibelWatt) { return _value; } + if (Unit == PowerRatioUnit.DecibelWatt) { return _value; } switch (Unit) { @@ -892,10 +892,10 @@ private double AsBaseUnitDecibelWatts() case PowerRatioUnit.DecibelWatt: return _value; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(PowerRatioUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs b/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs index f0199f2235..87e07167ea 100644 --- a/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs @@ -1590,14 +1590,14 @@ int CompareTo(Pressure other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(Pressure left, Pressure right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(Pressure left, Pressure right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -1605,15 +1605,14 @@ int CompareTo(Pressure other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is Pressure)) return false; - } - return AsBaseUnitPascals().Equals(((Pressure) obj).AsBaseUnitPascals()); + var objQuantity = (Pressure)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -1675,9 +1674,10 @@ public bool Equals(Pressure other, double tolerance, ComparisonType comparisonTy /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(Pressure, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(Pressure other, Pressure maxError) { - return Math.Abs(AsBaseUnitPascals() - other.AsBaseUnitPascals()) <= maxError.AsBaseUnitPascals(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -2101,7 +2101,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitPascals() { - if (Unit == PressureUnit.Pascal) { return _value; } + if (Unit == PressureUnit.Pascal) { return _value; } switch (Unit) { @@ -2145,10 +2145,10 @@ private double AsBaseUnitPascals() case PressureUnit.Torr: return _value*1.3332266752*1e2; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(PressureUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs index e9dccaa48b..b5d80beb04 100644 --- a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs @@ -467,14 +467,14 @@ int CompareTo(PressureChangeRate other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(PressureChangeRate left, PressureChangeRate right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(PressureChangeRate left, PressureChangeRate right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -482,15 +482,14 @@ int CompareTo(PressureChangeRate other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is PressureChangeRate)) return false; - } - return AsBaseUnitPascalsPerSecond().Equals(((PressureChangeRate) obj).AsBaseUnitPascalsPerSecond()); + var objQuantity = (PressureChangeRate)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -552,9 +551,10 @@ public bool Equals(PressureChangeRate other, double tolerance, ComparisonType co /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(PressureChangeRate, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(PressureChangeRate other, PressureChangeRate maxError) { - return Math.Abs(AsBaseUnitPascalsPerSecond() - other.AsBaseUnitPascalsPerSecond()) <= maxError.AsBaseUnitPascalsPerSecond(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -944,7 +944,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitPascalsPerSecond() { - if (Unit == PressureChangeRateUnit.PascalPerSecond) { return _value; } + if (Unit == PressureChangeRateUnit.PascalPerSecond) { return _value; } switch (Unit) { @@ -954,10 +954,10 @@ private double AsBaseUnitPascalsPerSecond() case PressureChangeRateUnit.PascalPerSecond: return _value; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(PressureChangeRateUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs b/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs index 23eedb139e..a032828c6b 100644 --- a/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs @@ -533,14 +533,14 @@ int CompareTo(Ratio other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(Ratio left, Ratio right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(Ratio left, Ratio right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -548,15 +548,14 @@ int CompareTo(Ratio other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is Ratio)) return false; - } - return AsBaseUnitDecimalFractions().Equals(((Ratio) obj).AsBaseUnitDecimalFractions()); + var objQuantity = (Ratio)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -618,9 +617,10 @@ public bool Equals(Ratio other, double tolerance, ComparisonType comparisonType) /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(Ratio, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(Ratio other, Ratio maxError) { - return Math.Abs(AsBaseUnitDecimalFractions() - other.AsBaseUnitDecimalFractions()) <= maxError.AsBaseUnitDecimalFractions(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -1012,7 +1012,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitDecimalFractions() { - if (Unit == RatioUnit.DecimalFraction) { return _value; } + if (Unit == RatioUnit.DecimalFraction) { return _value; } switch (Unit) { @@ -1024,10 +1024,10 @@ private double AsBaseUnitDecimalFractions() case RatioUnit.Percent: return _value/1e2; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(RatioUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.g.cs index 766b040dc7..1de41e01af 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.g.cs @@ -434,14 +434,14 @@ int CompareTo(ReactiveEnergy other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(ReactiveEnergy left, ReactiveEnergy right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(ReactiveEnergy left, ReactiveEnergy right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -449,15 +449,14 @@ int CompareTo(ReactiveEnergy other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is ReactiveEnergy)) return false; - } - return AsBaseUnitVoltampereReactiveHours().Equals(((ReactiveEnergy) obj).AsBaseUnitVoltampereReactiveHours()); + var objQuantity = (ReactiveEnergy)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -519,9 +518,10 @@ public bool Equals(ReactiveEnergy other, double tolerance, ComparisonType compar /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(ReactiveEnergy, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(ReactiveEnergy other, ReactiveEnergy maxError) { - return Math.Abs(AsBaseUnitVoltampereReactiveHours() - other.AsBaseUnitVoltampereReactiveHours()) <= maxError.AsBaseUnitVoltampereReactiveHours(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -910,7 +910,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitVoltampereReactiveHours() { - if (Unit == ReactiveEnergyUnit.VoltampereReactiveHour) { return _value; } + if (Unit == ReactiveEnergyUnit.VoltampereReactiveHour) { return _value; } switch (Unit) { @@ -919,10 +919,10 @@ private double AsBaseUnitVoltampereReactiveHours() case ReactiveEnergyUnit.VoltampereReactiveHour: return _value; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(ReactiveEnergyUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/ReactivePower.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactivePower.g.cs index 12a744cdad..01723497eb 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactivePower.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactivePower.g.cs @@ -467,14 +467,14 @@ int CompareTo(ReactivePower other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(ReactivePower left, ReactivePower right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(ReactivePower left, ReactivePower right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -482,15 +482,14 @@ int CompareTo(ReactivePower other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is ReactivePower)) return false; - } - return AsBaseUnitVoltamperesReactive().Equals(((ReactivePower) obj).AsBaseUnitVoltamperesReactive()); + var objQuantity = (ReactivePower)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -552,9 +551,10 @@ public bool Equals(ReactivePower other, double tolerance, ComparisonType compari /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(ReactivePower, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(ReactivePower other, ReactivePower maxError) { - return Math.Abs(AsBaseUnitVoltamperesReactive() - other.AsBaseUnitVoltamperesReactive()) <= maxError.AsBaseUnitVoltamperesReactive(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -944,7 +944,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitVoltamperesReactive() { - if (Unit == ReactivePowerUnit.VoltampereReactive) { return _value; } + if (Unit == ReactivePowerUnit.VoltampereReactive) { return _value; } switch (Unit) { @@ -954,10 +954,10 @@ private double AsBaseUnitVoltamperesReactive() case ReactivePowerUnit.VoltampereReactive: return _value; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(ReactivePowerUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.g.cs index 58229e3eb9..4bfc4c4a2e 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.g.cs @@ -434,14 +434,14 @@ int CompareTo(RotationalAcceleration other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(RotationalAcceleration left, RotationalAcceleration right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(RotationalAcceleration left, RotationalAcceleration right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -449,15 +449,14 @@ int CompareTo(RotationalAcceleration other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is RotationalAcceleration)) return false; - } - return AsBaseUnitRadiansPerSecondSquared().Equals(((RotationalAcceleration) obj).AsBaseUnitRadiansPerSecondSquared()); + var objQuantity = (RotationalAcceleration)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -519,9 +518,10 @@ public bool Equals(RotationalAcceleration other, double tolerance, ComparisonTyp /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(RotationalAcceleration, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(RotationalAcceleration other, RotationalAcceleration maxError) { - return Math.Abs(AsBaseUnitRadiansPerSecondSquared() - other.AsBaseUnitRadiansPerSecondSquared()) <= maxError.AsBaseUnitRadiansPerSecondSquared(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -910,7 +910,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitRadiansPerSecondSquared() { - if (Unit == RotationalAccelerationUnit.RadianPerSecondSquared) { return _value; } + if (Unit == RotationalAccelerationUnit.RadianPerSecondSquared) { return _value; } switch (Unit) { @@ -919,10 +919,10 @@ private double AsBaseUnitRadiansPerSecondSquared() case RotationalAccelerationUnit.RevolutionPerMinutePerSecond: return ((2*Math.PI)/60)*_value; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(RotationalAccelerationUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs index 324b127508..7021309635 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs @@ -764,14 +764,14 @@ int CompareTo(RotationalSpeed other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(RotationalSpeed left, RotationalSpeed right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(RotationalSpeed left, RotationalSpeed right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -779,15 +779,14 @@ int CompareTo(RotationalSpeed other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is RotationalSpeed)) return false; - } - return AsBaseUnitRadiansPerSecond().Equals(((RotationalSpeed) obj).AsBaseUnitRadiansPerSecond()); + var objQuantity = (RotationalSpeed)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -849,9 +848,10 @@ public bool Equals(RotationalSpeed other, double tolerance, ComparisonType compa /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(RotationalSpeed, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(RotationalSpeed other, RotationalSpeed maxError) { - return Math.Abs(AsBaseUnitRadiansPerSecond() - other.AsBaseUnitRadiansPerSecond()) <= maxError.AsBaseUnitRadiansPerSecond(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -1250,7 +1250,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitRadiansPerSecond() { - if (Unit == RotationalSpeedUnit.RadianPerSecond) { return _value; } + if (Unit == RotationalSpeedUnit.RadianPerSecond) { return _value; } switch (Unit) { @@ -1269,10 +1269,10 @@ private double AsBaseUnitRadiansPerSecond() case RotationalSpeedUnit.RevolutionPerSecond: return _value*6.2831853072; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(RotationalSpeedUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs index 6883a72d66..ab344a5ea6 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs @@ -434,14 +434,14 @@ int CompareTo(RotationalStiffness other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(RotationalStiffness left, RotationalStiffness right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(RotationalStiffness left, RotationalStiffness right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -449,15 +449,14 @@ int CompareTo(RotationalStiffness other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is RotationalStiffness)) return false; - } - return AsBaseUnitNewtonMetersPerRadian().Equals(((RotationalStiffness) obj).AsBaseUnitNewtonMetersPerRadian()); + var objQuantity = (RotationalStiffness)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -519,9 +518,10 @@ public bool Equals(RotationalStiffness other, double tolerance, ComparisonType c /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(RotationalStiffness, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(RotationalStiffness other, RotationalStiffness maxError) { - return Math.Abs(AsBaseUnitNewtonMetersPerRadian() - other.AsBaseUnitNewtonMetersPerRadian()) <= maxError.AsBaseUnitNewtonMetersPerRadian(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -910,7 +910,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitNewtonMetersPerRadian() { - if (Unit == RotationalStiffnessUnit.NewtonMeterPerRadian) { return _value; } + if (Unit == RotationalStiffnessUnit.NewtonMeterPerRadian) { return _value; } switch (Unit) { @@ -919,10 +919,10 @@ private double AsBaseUnitNewtonMetersPerRadian() case RotationalStiffnessUnit.NewtonMeterPerRadian: return _value; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(RotationalStiffnessUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs index 6955103855..39bb847e8f 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs @@ -434,14 +434,14 @@ int CompareTo(RotationalStiffnessPerLength other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(RotationalStiffnessPerLength left, RotationalStiffnessPerLength right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(RotationalStiffnessPerLength left, RotationalStiffnessPerLength right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -449,15 +449,14 @@ int CompareTo(RotationalStiffnessPerLength other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is RotationalStiffnessPerLength)) return false; - } - return AsBaseUnitNewtonMetersPerRadianPerMeter().Equals(((RotationalStiffnessPerLength) obj).AsBaseUnitNewtonMetersPerRadianPerMeter()); + var objQuantity = (RotationalStiffnessPerLength)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -519,9 +518,10 @@ public bool Equals(RotationalStiffnessPerLength other, double tolerance, Compari /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(RotationalStiffnessPerLength, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(RotationalStiffnessPerLength other, RotationalStiffnessPerLength maxError) { - return Math.Abs(AsBaseUnitNewtonMetersPerRadianPerMeter() - other.AsBaseUnitNewtonMetersPerRadianPerMeter()) <= maxError.AsBaseUnitNewtonMetersPerRadianPerMeter(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -910,7 +910,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitNewtonMetersPerRadianPerMeter() { - if (Unit == RotationalStiffnessPerLengthUnit.NewtonMeterPerRadianPerMeter) { return _value; } + if (Unit == RotationalStiffnessPerLengthUnit.NewtonMeterPerRadianPerMeter) { return _value; } switch (Unit) { @@ -919,10 +919,10 @@ private double AsBaseUnitNewtonMetersPerRadianPerMeter() case RotationalStiffnessPerLengthUnit.NewtonMeterPerRadianPerMeter: return _value; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(RotationalStiffnessPerLengthUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/SolidAngle.g.cs b/UnitsNet/GeneratedCode/Quantities/SolidAngle.g.cs index 276e3a9498..ededa73ea0 100644 --- a/UnitsNet/GeneratedCode/Quantities/SolidAngle.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SolidAngle.g.cs @@ -368,14 +368,14 @@ int CompareTo(SolidAngle other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(SolidAngle left, SolidAngle right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(SolidAngle left, SolidAngle right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -383,15 +383,14 @@ int CompareTo(SolidAngle other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is SolidAngle)) return false; - } - return AsBaseUnitSteradians().Equals(((SolidAngle) obj).AsBaseUnitSteradians()); + var objQuantity = (SolidAngle)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -453,9 +452,10 @@ public bool Equals(SolidAngle other, double tolerance, ComparisonType comparison /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(SolidAngle, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(SolidAngle other, SolidAngle maxError) { - return Math.Abs(AsBaseUnitSteradians() - other.AsBaseUnitSteradians()) <= maxError.AsBaseUnitSteradians(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -842,17 +842,17 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitSteradians() { - if (Unit == SolidAngleUnit.Steradian) { return _value; } + if (Unit == SolidAngleUnit.Steradian) { return _value; } switch (Unit) { case SolidAngleUnit.Steradian: return _value; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(SolidAngleUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs index 545955ff59..ac8f2a04ec 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs @@ -599,14 +599,14 @@ int CompareTo(SpecificEnergy other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(SpecificEnergy left, SpecificEnergy right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(SpecificEnergy left, SpecificEnergy right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -614,15 +614,14 @@ int CompareTo(SpecificEnergy other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is SpecificEnergy)) return false; - } - return AsBaseUnitJoulesPerKilogram().Equals(((SpecificEnergy) obj).AsBaseUnitJoulesPerKilogram()); + var objQuantity = (SpecificEnergy)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -684,9 +683,10 @@ public bool Equals(SpecificEnergy other, double tolerance, ComparisonType compar /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(SpecificEnergy, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(SpecificEnergy other, SpecificEnergy maxError) { - return Math.Abs(AsBaseUnitJoulesPerKilogram() - other.AsBaseUnitJoulesPerKilogram()) <= maxError.AsBaseUnitJoulesPerKilogram(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -1080,7 +1080,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitJoulesPerKilogram() { - if (Unit == SpecificEnergyUnit.JoulePerKilogram) { return _value; } + if (Unit == SpecificEnergyUnit.JoulePerKilogram) { return _value; } switch (Unit) { @@ -1094,10 +1094,10 @@ private double AsBaseUnitJoulesPerKilogram() case SpecificEnergyUnit.WattHourPerKilogram: return _value*3.6e3; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(SpecificEnergyUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs index 6d25836a7c..0e991700b9 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs @@ -599,14 +599,14 @@ int CompareTo(SpecificEntropy other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(SpecificEntropy left, SpecificEntropy right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(SpecificEntropy left, SpecificEntropy right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -614,15 +614,14 @@ int CompareTo(SpecificEntropy other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is SpecificEntropy)) return false; - } - return AsBaseUnitJoulesPerKilogramKelvin().Equals(((SpecificEntropy) obj).AsBaseUnitJoulesPerKilogramKelvin()); + var objQuantity = (SpecificEntropy)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -684,9 +683,10 @@ public bool Equals(SpecificEntropy other, double tolerance, ComparisonType compa /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(SpecificEntropy, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(SpecificEntropy other, SpecificEntropy maxError) { - return Math.Abs(AsBaseUnitJoulesPerKilogramKelvin() - other.AsBaseUnitJoulesPerKilogramKelvin()) <= maxError.AsBaseUnitJoulesPerKilogramKelvin(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -1080,7 +1080,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitJoulesPerKilogramKelvin() { - if (Unit == SpecificEntropyUnit.JoulePerKilogramKelvin) { return _value; } + if (Unit == SpecificEntropyUnit.JoulePerKilogramKelvin) { return _value; } switch (Unit) { @@ -1094,10 +1094,10 @@ private double AsBaseUnitJoulesPerKilogramKelvin() case SpecificEntropyUnit.MegajoulePerKilogramKelvin: return (_value) * 1e6d; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(SpecificEntropyUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs index 43654e94dc..8e99e17919 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs @@ -368,14 +368,14 @@ int CompareTo(SpecificVolume other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(SpecificVolume left, SpecificVolume right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(SpecificVolume left, SpecificVolume right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -383,15 +383,14 @@ int CompareTo(SpecificVolume other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is SpecificVolume)) return false; - } - return AsBaseUnitCubicMetersPerKilogram().Equals(((SpecificVolume) obj).AsBaseUnitCubicMetersPerKilogram()); + var objQuantity = (SpecificVolume)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -453,9 +452,10 @@ public bool Equals(SpecificVolume other, double tolerance, ComparisonType compar /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(SpecificVolume, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(SpecificVolume other, SpecificVolume maxError) { - return Math.Abs(AsBaseUnitCubicMetersPerKilogram() - other.AsBaseUnitCubicMetersPerKilogram()) <= maxError.AsBaseUnitCubicMetersPerKilogram(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -842,17 +842,17 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitCubicMetersPerKilogram() { - if (Unit == SpecificVolumeUnit.CubicMeterPerKilogram) { return _value; } + if (Unit == SpecificVolumeUnit.CubicMeterPerKilogram) { return _value; } switch (Unit) { case SpecificVolumeUnit.CubicMeterPerKilogram: return _value; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(SpecificVolumeUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs index 126fcfd024..5ee4aa961a 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs @@ -896,14 +896,14 @@ int CompareTo(SpecificWeight other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(SpecificWeight left, SpecificWeight right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(SpecificWeight left, SpecificWeight right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -911,15 +911,14 @@ int CompareTo(SpecificWeight other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is SpecificWeight)) return false; - } - return AsBaseUnitNewtonsPerCubicMeter().Equals(((SpecificWeight) obj).AsBaseUnitNewtonsPerCubicMeter()); + var objQuantity = (SpecificWeight)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -981,9 +980,10 @@ public bool Equals(SpecificWeight other, double tolerance, ComparisonType compar /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(SpecificWeight, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(SpecificWeight other, SpecificWeight maxError) { - return Math.Abs(AsBaseUnitNewtonsPerCubicMeter() - other.AsBaseUnitNewtonsPerCubicMeter()) <= maxError.AsBaseUnitNewtonsPerCubicMeter(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -1386,7 +1386,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitNewtonsPerCubicMeter() { - if (Unit == SpecificWeightUnit.NewtonPerCubicMeter) { return _value; } + if (Unit == SpecificWeightUnit.NewtonPerCubicMeter) { return _value; } switch (Unit) { @@ -1409,10 +1409,10 @@ private double AsBaseUnitNewtonsPerCubicMeter() case SpecificWeightUnit.TonneForcePerCubicMillimeter: return _value*9.80665e12; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(SpecificWeightUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/Speed.g.cs b/UnitsNet/GeneratedCode/Quantities/Speed.g.cs index de1d078955..2dac3b5804 100644 --- a/UnitsNet/GeneratedCode/Quantities/Speed.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Speed.g.cs @@ -1391,14 +1391,14 @@ int CompareTo(Speed other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(Speed left, Speed right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(Speed left, Speed right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -1406,15 +1406,14 @@ int CompareTo(Speed other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is Speed)) return false; - } - return AsBaseUnitMetersPerSecond().Equals(((Speed) obj).AsBaseUnitMetersPerSecond()); + var objQuantity = (Speed)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -1476,9 +1475,10 @@ public bool Equals(Speed other, double tolerance, ComparisonType comparisonType) /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(Speed, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(Speed other, Speed maxError) { - return Math.Abs(AsBaseUnitMetersPerSecond() - other.AsBaseUnitMetersPerSecond()) <= maxError.AsBaseUnitMetersPerSecond(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -1896,7 +1896,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitMetersPerSecond() { - if (Unit == SpeedUnit.MeterPerSecond) { return _value; } + if (Unit == SpeedUnit.MeterPerSecond) { return _value; } switch (Unit) { @@ -1934,10 +1934,10 @@ private double AsBaseUnitMetersPerSecond() case SpeedUnit.YardPerSecond: return _value*0.9144; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(SpeedUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/Temperature.g.cs b/UnitsNet/GeneratedCode/Quantities/Temperature.g.cs index e901ad3acf..2400fcce8f 100644 --- a/UnitsNet/GeneratedCode/Quantities/Temperature.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Temperature.g.cs @@ -557,14 +557,14 @@ int CompareTo(Temperature other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(Temperature left, Temperature right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(Temperature left, Temperature right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -572,15 +572,14 @@ int CompareTo(Temperature other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is Temperature)) return false; - } - return AsBaseUnitKelvins().Equals(((Temperature) obj).AsBaseUnitKelvins()); + var objQuantity = (Temperature)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -642,9 +641,10 @@ public bool Equals(Temperature other, double tolerance, ComparisonType compariso /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(Temperature, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(Temperature other, Temperature maxError) { - return Math.Abs(AsBaseUnitKelvins() - other.AsBaseUnitKelvins()) <= maxError.AsBaseUnitKelvins(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -1038,7 +1038,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitKelvins() { - if (Unit == TemperatureUnit.Kelvin) { return _value; } + if (Unit == TemperatureUnit.Kelvin) { return _value; } switch (Unit) { @@ -1052,10 +1052,10 @@ private double AsBaseUnitKelvins() case TemperatureUnit.Kelvin: return _value; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(TemperatureUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.g.cs index 8fb212380f..a275fbf99e 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.g.cs @@ -665,14 +665,14 @@ int CompareTo(TemperatureChangeRate other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(TemperatureChangeRate left, TemperatureChangeRate right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(TemperatureChangeRate left, TemperatureChangeRate right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -680,15 +680,14 @@ int CompareTo(TemperatureChangeRate other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is TemperatureChangeRate)) return false; - } - return AsBaseUnitDegreesCelsiusPerSecond().Equals(((TemperatureChangeRate) obj).AsBaseUnitDegreesCelsiusPerSecond()); + var objQuantity = (TemperatureChangeRate)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -750,9 +749,10 @@ public bool Equals(TemperatureChangeRate other, double tolerance, ComparisonType /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(TemperatureChangeRate, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(TemperatureChangeRate other, TemperatureChangeRate maxError) { - return Math.Abs(AsBaseUnitDegreesCelsiusPerSecond() - other.AsBaseUnitDegreesCelsiusPerSecond()) <= maxError.AsBaseUnitDegreesCelsiusPerSecond(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -1148,7 +1148,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitDegreesCelsiusPerSecond() { - if (Unit == TemperatureChangeRateUnit.DegreeCelsiusPerSecond) { return _value; } + if (Unit == TemperatureChangeRateUnit.DegreeCelsiusPerSecond) { return _value; } switch (Unit) { @@ -1164,10 +1164,10 @@ private double AsBaseUnitDegreesCelsiusPerSecond() case TemperatureChangeRateUnit.NanodegreeCelsiusPerSecond: return (_value) * 1e-9d; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(TemperatureChangeRateUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs index 2b27086367..83b1017d7b 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs @@ -871,14 +871,14 @@ int CompareTo(TemperatureDelta other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(TemperatureDelta left, TemperatureDelta right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(TemperatureDelta left, TemperatureDelta right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -886,15 +886,14 @@ int CompareTo(TemperatureDelta other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is TemperatureDelta)) return false; - } - return AsBaseUnitKelvins().Equals(((TemperatureDelta) obj).AsBaseUnitKelvins()); + var objQuantity = (TemperatureDelta)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -956,9 +955,10 @@ public bool Equals(TemperatureDelta other, double tolerance, ComparisonType comp /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(TemperatureDelta, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(TemperatureDelta other, TemperatureDelta maxError) { - return Math.Abs(AsBaseUnitKelvins() - other.AsBaseUnitKelvins()) <= maxError.AsBaseUnitKelvins(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -1360,7 +1360,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitKelvins() { - if (Unit == TemperatureDeltaUnit.Kelvin) { return _value; } + if (Unit == TemperatureDeltaUnit.Kelvin) { return _value; } switch (Unit) { @@ -1382,10 +1382,10 @@ private double AsBaseUnitKelvins() case TemperatureDeltaUnit.KelvinDelta: return _value; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(TemperatureDeltaUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.g.cs index 34a1a31f5b..58f69bbd6c 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.g.cs @@ -401,14 +401,14 @@ int CompareTo(ThermalConductivity other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(ThermalConductivity left, ThermalConductivity right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(ThermalConductivity left, ThermalConductivity right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -416,15 +416,14 @@ int CompareTo(ThermalConductivity other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is ThermalConductivity)) return false; - } - return AsBaseUnitWattsPerMeterKelvin().Equals(((ThermalConductivity) obj).AsBaseUnitWattsPerMeterKelvin()); + var objQuantity = (ThermalConductivity)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -486,9 +485,10 @@ public bool Equals(ThermalConductivity other, double tolerance, ComparisonType c /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(ThermalConductivity, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(ThermalConductivity other, ThermalConductivity maxError) { - return Math.Abs(AsBaseUnitWattsPerMeterKelvin() - other.AsBaseUnitWattsPerMeterKelvin()) <= maxError.AsBaseUnitWattsPerMeterKelvin(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -876,7 +876,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitWattsPerMeterKelvin() { - if (Unit == ThermalConductivityUnit.WattPerMeterKelvin) { return _value; } + if (Unit == ThermalConductivityUnit.WattPerMeterKelvin) { return _value; } switch (Unit) { @@ -884,10 +884,10 @@ private double AsBaseUnitWattsPerMeterKelvin() case ThermalConductivityUnit.WattPerMeterKelvin: return _value; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(ThermalConductivityUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.g.cs index 742c2b1eb6..b192f72b8f 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.g.cs @@ -500,14 +500,14 @@ int CompareTo(ThermalResistance other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(ThermalResistance left, ThermalResistance right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(ThermalResistance left, ThermalResistance right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -515,15 +515,14 @@ int CompareTo(ThermalResistance other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is ThermalResistance)) return false; - } - return AsBaseUnitSquareMeterKelvinsPerKilowatt().Equals(((ThermalResistance) obj).AsBaseUnitSquareMeterKelvinsPerKilowatt()); + var objQuantity = (ThermalResistance)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -585,9 +584,10 @@ public bool Equals(ThermalResistance other, double tolerance, ComparisonType com /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(ThermalResistance, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(ThermalResistance other, ThermalResistance maxError) { - return Math.Abs(AsBaseUnitSquareMeterKelvinsPerKilowatt() - other.AsBaseUnitSquareMeterKelvinsPerKilowatt()) <= maxError.AsBaseUnitSquareMeterKelvinsPerKilowatt(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -978,7 +978,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitSquareMeterKelvinsPerKilowatt() { - if (Unit == ThermalResistanceUnit.SquareMeterKelvinPerKilowatt) { return _value; } + if (Unit == ThermalResistanceUnit.SquareMeterKelvinPerKilowatt) { return _value; } switch (Unit) { @@ -989,10 +989,10 @@ private double AsBaseUnitSquareMeterKelvinsPerKilowatt() case ThermalResistanceUnit.SquareMeterKelvinPerKilowatt: return _value; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(ThermalResistanceUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/Torque.g.cs b/UnitsNet/GeneratedCode/Quantities/Torque.g.cs index 6b583bd9f2..9630257681 100644 --- a/UnitsNet/GeneratedCode/Quantities/Torque.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Torque.g.cs @@ -1028,14 +1028,14 @@ int CompareTo(Torque other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(Torque left, Torque right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(Torque left, Torque right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -1043,15 +1043,14 @@ int CompareTo(Torque other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is Torque)) return false; - } - return AsBaseUnitNewtonMeters().Equals(((Torque) obj).AsBaseUnitNewtonMeters()); + var objQuantity = (Torque)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -1113,9 +1112,10 @@ public bool Equals(Torque other, double tolerance, ComparisonType comparisonType /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(Torque, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(Torque other, Torque maxError) { - return Math.Abs(AsBaseUnitNewtonMeters() - other.AsBaseUnitNewtonMeters()) <= maxError.AsBaseUnitNewtonMeters(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -1522,7 +1522,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitNewtonMeters() { - if (Unit == TorqueUnit.NewtonMeter) { return _value; } + if (Unit == TorqueUnit.NewtonMeter) { return _value; } switch (Unit) { @@ -1549,10 +1549,10 @@ private double AsBaseUnitNewtonMeters() case TorqueUnit.TonneForceMillimeter: return _value*9.80665019960652; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(TorqueUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/VitaminA.g.cs b/UnitsNet/GeneratedCode/Quantities/VitaminA.g.cs index c1fc827e7a..1b4da0118a 100644 --- a/UnitsNet/GeneratedCode/Quantities/VitaminA.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VitaminA.g.cs @@ -368,14 +368,14 @@ int CompareTo(VitaminA other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(VitaminA left, VitaminA right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(VitaminA left, VitaminA right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -383,15 +383,14 @@ int CompareTo(VitaminA other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is VitaminA)) return false; - } - return AsBaseUnitInternationalUnits().Equals(((VitaminA) obj).AsBaseUnitInternationalUnits()); + var objQuantity = (VitaminA)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -453,9 +452,10 @@ public bool Equals(VitaminA other, double tolerance, ComparisonType comparisonTy /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(VitaminA, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(VitaminA other, VitaminA maxError) { - return Math.Abs(AsBaseUnitInternationalUnits() - other.AsBaseUnitInternationalUnits()) <= maxError.AsBaseUnitInternationalUnits(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -842,17 +842,17 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitInternationalUnits() { - if (Unit == VitaminAUnit.InternationalUnit) { return _value; } + if (Unit == VitaminAUnit.InternationalUnit) { return _value; } switch (Unit) { case VitaminAUnit.InternationalUnit: return _value; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(VitaminAUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/Volume.g.cs b/UnitsNet/GeneratedCode/Quantities/Volume.g.cs index bf3475ef77..a0f5b936d0 100644 --- a/UnitsNet/GeneratedCode/Quantities/Volume.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Volume.g.cs @@ -1789,14 +1789,14 @@ int CompareTo(Volume other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(Volume left, Volume right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(Volume left, Volume right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -1804,15 +1804,14 @@ int CompareTo(Volume other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is Volume)) return false; - } - return AsBaseUnitCubicMeters().Equals(((Volume) obj).AsBaseUnitCubicMeters()); + var objQuantity = (Volume)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -1874,9 +1873,10 @@ public bool Equals(Volume other, double tolerance, ComparisonType comparisonType /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(Volume, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(Volume other, Volume maxError) { - return Math.Abs(AsBaseUnitCubicMeters() - other.AsBaseUnitCubicMeters()) <= maxError.AsBaseUnitCubicMeters(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -2306,7 +2306,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitCubicMeters() { - if (Unit == VolumeUnit.CubicMeter) { return _value; } + if (Unit == VolumeUnit.CubicMeter) { return _value; } switch (Unit) { @@ -2356,10 +2356,10 @@ private double AsBaseUnitCubicMeters() case VolumeUnit.UsTeaspoon: return _value*4.92892159375e-6; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(VolumeUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs index c35cf5b545..77eb345424 100644 --- a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs @@ -1127,14 +1127,14 @@ int CompareTo(VolumeFlow other) return left.Value > right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator ==(VolumeFlow left, VolumeFlow right) { // ReSharper disable once CompareOfFloatsByEqualityOperator return left.Value == right.AsBaseNumericType(left.Unit); } - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public static bool operator !=(VolumeFlow left, VolumeFlow right) { // ReSharper disable once CompareOfFloatsByEqualityOperator @@ -1142,15 +1142,14 @@ int CompareTo(VolumeFlow other) } #endif - [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")] + [Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")] public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is VolumeFlow)) return false; - } - return AsBaseUnitCubicMetersPerSecond().Equals(((VolumeFlow) obj).AsBaseUnitCubicMetersPerSecond()); + var objQuantity = (VolumeFlow)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -1212,9 +1211,10 @@ public bool Equals(VolumeFlow other, double tolerance, ComparisonType comparison /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals(VolumeFlow, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(VolumeFlow other, VolumeFlow maxError) { - return Math.Abs(AsBaseUnitCubicMetersPerSecond() - other.AsBaseUnitCubicMetersPerSecond()) <= maxError.AsBaseUnitCubicMetersPerSecond(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -1624,7 +1624,7 @@ public string ToString( /// The value in the base unit representation. private double AsBaseUnitCubicMetersPerSecond() { - if (Unit == VolumeFlowUnit.CubicMeterPerSecond) { return _value; } + if (Unit == VolumeFlowUnit.CubicMeterPerSecond) { return _value; } switch (Unit) { @@ -1654,10 +1654,10 @@ private double AsBaseUnitCubicMetersPerSecond() case VolumeFlowUnit.UsGallonsPerSecond: return _value/264.1720523581484; default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private double AsBaseNumericType(VolumeFlowUnit unit) => Convert.ToDouble(As(unit)); - } + } } diff --git a/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 b/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 index aa7c68f6fa..63c1704755 100644 --- a/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 +++ b/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 @@ -25,7 +25,7 @@ $obsoleteEqualityIfDouble = '' if ($quantity.BaseType -eq "double") { - $obsoleteEqualityIfDouble = '[Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals(other, maxError) to provide the max allowed error.")]' + "`n " + $obsoleteEqualityIfDouble = '[Obsolete("It is not safe to compare equality due to using System.Double as the internal representation. It is very easy to get slightly different values due to floating point operations. Instead use Equals($quantityName, double, ComparisonType) to provide the max allowed absolute or relative error.")]' + "`r`n " } @" @@ -194,7 +194,7 @@ namespace UnitsNet /// public static $unitEnumName[] Units { get; } = Enum.GetValues(typeof($unitEnumName)).Cast<$unitEnumName>().ToArray(); "@; - foreach ($unit in $units) { + foreach ($unit in $units) { $propertyName = $unit.PluralName; $obsoleteAttribute = GetObsoleteAttribute($unit); if ($obsoleteAttribute) @@ -436,12 +436,11 @@ namespace UnitsNet $($obsoleteEqualityIfDouble)public override bool Equals(object obj) { - if (obj == null || GetType() != obj.GetType()) - { + if(obj is null || !(obj is $quantityName)) return false; - } - return AsBaseUnit$baseUnitPluralName().Equals((($quantityName) obj).AsBaseUnit$baseUnitPluralName()); + var objQuantity = ($quantityName)obj; + return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -503,9 +502,10 @@ namespace UnitsNet /// Other quantity to compare to. /// Max error allowed. /// True if the difference between the two values is not greater than the specified max. + [Obsolete("Please use the Equals($quantityName, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals($quantityName other, $quantityName maxError) { - return Math.Abs(AsBaseUnit$baseUnitPluralName() - other.AsBaseUnit$baseUnitPluralName()) <= maxError.AsBaseUnit$baseUnitPluralName(); + return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() @@ -533,7 +533,7 @@ namespace UnitsNet switch (unit) { "@; foreach ($unit in $units) { - $func = $unit.FromBaseToUnitFunc.Replace("x", "baseUnitValue");@" + $func = $unit.FromBaseToUnitFunc.Replace("x", "baseUnitValue");@" case $unitEnumName.$($unit.SingularName): return $func; "@; }@" @@ -895,22 +895,22 @@ namespace UnitsNet /// The value in the base unit representation. private $baseType AsBaseUnit$baseUnitPluralName() { - if (Unit == $unitEnumName.$baseUnitSingularName) { return _value; } + if (Unit == $unitEnumName.$baseUnitSingularName) { return _value; } switch (Unit) { "@; foreach ($unit in $units) { - $func = $unit.FromUnitToBaseFunc.Replace("x", "_value");@" + $func = $unit.FromUnitToBaseFunc.Replace("x", "_value");@" case $unitEnumName.$($unit.SingularName): return $func; "@; }@" default: throw new NotImplementedException("Unit not implemented: " + Unit); - } - } + } + } - /// Convenience method for working with internal numeric type. + /// Convenience method for working with internal numeric type. private $baseType AsBaseNumericType($unitEnumName unit) => $convertToBaseType(As(unit)); - } + } } "@; } From d35958ca95c2e03b616ce0d3eafd4caf1fc3c450 Mon Sep 17 00:00:00 2001 From: Tristan Milnthorp Date: Tue, 26 Jun 2018 10:32:43 -0400 Subject: [PATCH 19/19] Fix for WRC when value is always double. --- UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Angle.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Area.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/BitRate.g.cs | 4 ++-- .../Quantities/BrakeSpecificFuelConsumption.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Capacitance.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Density.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Duration.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs | 4 ++-- .../GeneratedCode/Quantities/ElectricCurrentGradient.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Energy.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Entropy.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Flow.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Force.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Frequency.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs | 4 ++-- .../GeneratedCode/Quantities/HeatTransferCoefficient.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Information.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/LapseRate.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Length.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Level.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/LuminousFlux.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/MagneticField.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/MagneticFlux.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Magnetization.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Mass.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/MolarEnergy.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/MolarEntropy.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Molarity.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Permeability.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Permittivity.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Power.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/PowerRatio.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Pressure.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Ratio.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/ReactivePower.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs | 4 ++-- .../Quantities/RotationalStiffnessPerLength.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/SolidAngle.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Speed.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Temperature.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/ThermalConductivity.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/ThermalResistance.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Torque.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/VitaminA.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/Volume.g.cs | 4 ++-- UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs | 4 ++-- UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 | 4 ++-- 91 files changed, 182 insertions(+), 182 deletions(-) diff --git a/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs b/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs index 1b12647523..928559dbe5 100644 --- a/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs @@ -796,7 +796,7 @@ public override bool Equals(object obj) return false; var objQuantity = (Acceleration)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -861,7 +861,7 @@ public bool Equals(Acceleration other, double tolerance, ComparisonType comparis [Obsolete("Please use the Equals(Acceleration, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(Acceleration other, Acceleration maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs index 9dccf30b19..f4bf8c52a1 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs @@ -829,7 +829,7 @@ public override bool Equals(object obj) return false; var objQuantity = (AmountOfSubstance)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -894,7 +894,7 @@ public bool Equals(AmountOfSubstance other, double tolerance, ComparisonType com [Obsolete("Please use the Equals(AmountOfSubstance, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(AmountOfSubstance other, AmountOfSubstance maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs index f94c897c21..6a5990989c 100644 --- a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs @@ -497,7 +497,7 @@ public override bool Equals(object obj) return false; var objQuantity = (AmplitudeRatio)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -562,7 +562,7 @@ public bool Equals(AmplitudeRatio other, double tolerance, ComparisonType compar [Obsolete("Please use the Equals(AmplitudeRatio, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(AmplitudeRatio other, AmplitudeRatio maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/Angle.g.cs b/UnitsNet/GeneratedCode/Quantities/Angle.g.cs index b3e0d08e7b..5d5a275499 100644 --- a/UnitsNet/GeneratedCode/Quantities/Angle.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Angle.g.cs @@ -819,7 +819,7 @@ public override bool Equals(object obj) return false; var objQuantity = (Angle)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -884,7 +884,7 @@ public bool Equals(Angle other, double tolerance, ComparisonType comparisonType) [Obsolete("Please use the Equals(Angle, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(Angle other, Angle maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs index 5991a79c3e..50d63f9f1a 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs @@ -466,7 +466,7 @@ public override bool Equals(object obj) return false; var objQuantity = (ApparentEnergy)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -531,7 +531,7 @@ public bool Equals(ApparentEnergy other, double tolerance, ComparisonType compar [Obsolete("Please use the Equals(ApparentEnergy, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(ApparentEnergy other, ApparentEnergy maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs index b4687ddabc..e2d7cf44d3 100644 --- a/UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs @@ -499,7 +499,7 @@ public override bool Equals(object obj) return false; var objQuantity = (ApparentPower)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -564,7 +564,7 @@ public bool Equals(ApparentPower other, double tolerance, ComparisonType compari [Obsolete("Please use the Equals(ApparentPower, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(ApparentPower other, ApparentPower maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/Area.g.cs b/UnitsNet/GeneratedCode/Quantities/Area.g.cs index eaafdc8daf..4b2ded604f 100644 --- a/UnitsNet/GeneratedCode/Quantities/Area.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Area.g.cs @@ -796,7 +796,7 @@ public override bool Equals(object obj) return false; var objQuantity = (Area)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -861,7 +861,7 @@ public bool Equals(Area other, double tolerance, ComparisonType comparisonType) [Obsolete("Please use the Equals(Area, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(Area other, Area maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs index 3a24e5d7a5..21b7fd32ed 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs @@ -400,7 +400,7 @@ public override bool Equals(object obj) return false; var objQuantity = (AreaDensity)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -465,7 +465,7 @@ public bool Equals(AreaDensity other, double tolerance, ComparisonType compariso [Obsolete("Please use the Equals(AreaDensity, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(AreaDensity other, AreaDensity maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs index 30a5219351..8bd385a266 100644 --- a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs @@ -565,7 +565,7 @@ public override bool Equals(object obj) return false; var objQuantity = (AreaMomentOfInertia)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -630,7 +630,7 @@ public bool Equals(AreaMomentOfInertia other, double tolerance, ComparisonType c [Obsolete("Please use the Equals(AreaMomentOfInertia, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(AreaMomentOfInertia other, AreaMomentOfInertia maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/BitRate.g.cs b/UnitsNet/GeneratedCode/Quantities/BitRate.g.cs index b504714940..1ec28f5d44 100644 --- a/UnitsNet/GeneratedCode/Quantities/BitRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BitRate.g.cs @@ -1212,7 +1212,7 @@ public override bool Equals(object obj) return false; var objQuantity = (BitRate)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -1277,7 +1277,7 @@ public bool Equals(BitRate other, double tolerance, ComparisonType comparisonTyp [Obsolete("Please use the Equals(BitRate, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(BitRate other, BitRate maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs index 961f4148aa..894b5604c2 100644 --- a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs @@ -466,7 +466,7 @@ public override bool Equals(object obj) return false; var objQuantity = (BrakeSpecificFuelConsumption)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -531,7 +531,7 @@ public bool Equals(BrakeSpecificFuelConsumption other, double tolerance, Compari [Obsolete("Please use the Equals(BrakeSpecificFuelConsumption, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(BrakeSpecificFuelConsumption other, BrakeSpecificFuelConsumption maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/Capacitance.g.cs b/UnitsNet/GeneratedCode/Quantities/Capacitance.g.cs index 504778ae3e..f7f10f69cc 100644 --- a/UnitsNet/GeneratedCode/Quantities/Capacitance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Capacitance.g.cs @@ -400,7 +400,7 @@ public override bool Equals(object obj) return false; var objQuantity = (Capacitance)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -465,7 +465,7 @@ public bool Equals(Capacitance other, double tolerance, ComparisonType compariso [Obsolete("Please use the Equals(Capacitance, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(Capacitance other, Capacitance maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/Density.g.cs b/UnitsNet/GeneratedCode/Quantities/Density.g.cs index 0210248dca..1b6daf4268 100644 --- a/UnitsNet/GeneratedCode/Quantities/Density.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Density.g.cs @@ -1621,7 +1621,7 @@ public override bool Equals(object obj) return false; var objQuantity = (Density)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -1686,7 +1686,7 @@ public bool Equals(Density other, double tolerance, ComparisonType comparisonTyp [Obsolete("Please use the Equals(Density, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(Density other, Density maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/Duration.g.cs b/UnitsNet/GeneratedCode/Quantities/Duration.g.cs index 71f7928f32..7de38fb031 100644 --- a/UnitsNet/GeneratedCode/Quantities/Duration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Duration.g.cs @@ -765,7 +765,7 @@ public override bool Equals(object obj) return false; var objQuantity = (Duration)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -830,7 +830,7 @@ public bool Equals(Duration other, double tolerance, ComparisonType comparisonTy [Obsolete("Please use the Equals(Duration, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(Duration other, Duration maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs index ba09eb19f3..c3ba087908 100644 --- a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs @@ -565,7 +565,7 @@ public override bool Equals(object obj) return false; var objQuantity = (DynamicViscosity)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -630,7 +630,7 @@ public bool Equals(DynamicViscosity other, double tolerance, ComparisonType comp [Obsolete("Please use the Equals(DynamicViscosity, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(DynamicViscosity other, DynamicViscosity maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs index 25d13f7a3d..b9533fea0c 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs @@ -499,7 +499,7 @@ public override bool Equals(object obj) return false; var objQuantity = (ElectricAdmittance)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -564,7 +564,7 @@ public bool Equals(ElectricAdmittance other, double tolerance, ComparisonType co [Obsolete("Please use the Equals(ElectricAdmittance, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(ElectricAdmittance other, ElectricAdmittance maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs index b62d2e0e17..7c9d3c58c9 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs @@ -400,7 +400,7 @@ public override bool Equals(object obj) return false; var objQuantity = (ElectricCharge)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -465,7 +465,7 @@ public bool Equals(ElectricCharge other, double tolerance, ComparisonType compar [Obsolete("Please use the Equals(ElectricCharge, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(ElectricCharge other, ElectricCharge maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs index 187d15aab0..a79a8bdaea 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs @@ -400,7 +400,7 @@ public override bool Equals(object obj) return false; var objQuantity = (ElectricChargeDensity)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -465,7 +465,7 @@ public bool Equals(ElectricChargeDensity other, double tolerance, ComparisonType [Obsolete("Please use the Equals(ElectricChargeDensity, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(ElectricChargeDensity other, ElectricChargeDensity maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs index 0e02068577..3ad34cee8b 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs @@ -466,7 +466,7 @@ public override bool Equals(object obj) return false; var objQuantity = (ElectricConductance)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -531,7 +531,7 @@ public bool Equals(ElectricConductance other, double tolerance, ComparisonType c [Obsolete("Please use the Equals(ElectricConductance, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(ElectricConductance other, ElectricConductance maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs index a4098e5fd4..96c4174919 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs @@ -400,7 +400,7 @@ public override bool Equals(object obj) return false; var objQuantity = (ElectricConductivity)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -465,7 +465,7 @@ public bool Equals(ElectricConductivity other, double tolerance, ComparisonType [Obsolete("Please use the Equals(ElectricConductivity, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(ElectricConductivity other, ElectricConductivity maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs index 724ee7a090..0b82c7216c 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs @@ -598,7 +598,7 @@ public override bool Equals(object obj) return false; var objQuantity = (ElectricCurrent)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -663,7 +663,7 @@ public bool Equals(ElectricCurrent other, double tolerance, ComparisonType compa [Obsolete("Please use the Equals(ElectricCurrent, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(ElectricCurrent other, ElectricCurrent maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs index 806357d2dd..50c3ec04b6 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs @@ -400,7 +400,7 @@ public override bool Equals(object obj) return false; var objQuantity = (ElectricCurrentDensity)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -465,7 +465,7 @@ public bool Equals(ElectricCurrentDensity other, double tolerance, ComparisonTyp [Obsolete("Please use the Equals(ElectricCurrentDensity, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(ElectricCurrentDensity other, ElectricCurrentDensity maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs index 9e627f2bab..725e8cc570 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs @@ -400,7 +400,7 @@ public override bool Equals(object obj) return false; var objQuantity = (ElectricCurrentGradient)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -465,7 +465,7 @@ public bool Equals(ElectricCurrentGradient other, double tolerance, ComparisonTy [Obsolete("Please use the Equals(ElectricCurrentGradient, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(ElectricCurrentGradient other, ElectricCurrentGradient maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs index 2a1f14a442..f157c4bb95 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs @@ -400,7 +400,7 @@ public override bool Equals(object obj) return false; var objQuantity = (ElectricField)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -465,7 +465,7 @@ public bool Equals(ElectricField other, double tolerance, ComparisonType compari [Obsolete("Please use the Equals(ElectricField, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(ElectricField other, ElectricField maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs index 845b6e3e69..db2ed030f8 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs @@ -400,7 +400,7 @@ public override bool Equals(object obj) return false; var objQuantity = (ElectricInductance)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -465,7 +465,7 @@ public bool Equals(ElectricInductance other, double tolerance, ComparisonType co [Obsolete("Please use the Equals(ElectricInductance, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(ElectricInductance other, ElectricInductance maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs index 008c10a7fe..f4ef8b4a7c 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs @@ -532,7 +532,7 @@ public override bool Equals(object obj) return false; var objQuantity = (ElectricPotential)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -597,7 +597,7 @@ public bool Equals(ElectricPotential other, double tolerance, ComparisonType com [Obsolete("Please use the Equals(ElectricPotential, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(ElectricPotential other, ElectricPotential maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.g.cs index 431dc3e63b..2f4e7cb6ab 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.g.cs @@ -522,7 +522,7 @@ public override bool Equals(object obj) return false; var objQuantity = (ElectricPotentialAc)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -587,7 +587,7 @@ public bool Equals(ElectricPotentialAc other, double tolerance, ComparisonType c [Obsolete("Please use the Equals(ElectricPotentialAc, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(ElectricPotentialAc other, ElectricPotentialAc maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.g.cs index 2272a784b5..f042f33d3b 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.g.cs @@ -522,7 +522,7 @@ public override bool Equals(object obj) return false; var objQuantity = (ElectricPotentialDc)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -587,7 +587,7 @@ public bool Equals(ElectricPotentialDc other, double tolerance, ComparisonType c [Obsolete("Please use the Equals(ElectricPotentialDc, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(ElectricPotentialDc other, ElectricPotentialDc maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs index 1c73d97c04..207d1b87ad 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs @@ -499,7 +499,7 @@ public override bool Equals(object obj) return false; var objQuantity = (ElectricResistance)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -564,7 +564,7 @@ public bool Equals(ElectricResistance other, double tolerance, ComparisonType co [Obsolete("Please use the Equals(ElectricResistance, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(ElectricResistance other, ElectricResistance maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs index 89b8905da7..9ffea0adec 100644 --- a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs @@ -499,7 +499,7 @@ public override bool Equals(object obj) return false; var objQuantity = (ElectricResistivity)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -564,7 +564,7 @@ public bool Equals(ElectricResistivity other, double tolerance, ComparisonType c [Obsolete("Please use the Equals(ElectricResistivity, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(ElectricResistivity other, ElectricResistivity maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/Energy.g.cs b/UnitsNet/GeneratedCode/Quantities/Energy.g.cs index f912dd9f5b..b8cc7fee87 100644 --- a/UnitsNet/GeneratedCode/Quantities/Energy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Energy.g.cs @@ -1093,7 +1093,7 @@ public override bool Equals(object obj) return false; var objQuantity = (Energy)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -1158,7 +1158,7 @@ public bool Equals(Energy other, double tolerance, ComparisonType comparisonType [Obsolete("Please use the Equals(Energy, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(Energy other, Energy maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs b/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs index b8ecada0b1..aef57c45c2 100644 --- a/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs @@ -598,7 +598,7 @@ public override bool Equals(object obj) return false; var objQuantity = (Entropy)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -663,7 +663,7 @@ public bool Equals(Entropy other, double tolerance, ComparisonType comparisonTyp [Obsolete("Please use the Equals(Entropy, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(Entropy other, Entropy maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/Flow.g.cs b/UnitsNet/GeneratedCode/Quantities/Flow.g.cs index d090eabf8a..c36703e8ac 100644 --- a/UnitsNet/GeneratedCode/Quantities/Flow.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Flow.g.cs @@ -1177,7 +1177,7 @@ public override bool Equals(object obj) return false; var objQuantity = (Flow)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -1242,7 +1242,7 @@ public bool Equals(Flow other, double tolerance, ComparisonType comparisonType) [Obsolete("Please use the Equals(Flow, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(Flow other, Flow maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/Force.g.cs b/UnitsNet/GeneratedCode/Quantities/Force.g.cs index e16a9e2663..65bfca8774 100644 --- a/UnitsNet/GeneratedCode/Quantities/Force.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Force.g.cs @@ -697,7 +697,7 @@ public override bool Equals(object obj) return false; var objQuantity = (Force)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -762,7 +762,7 @@ public bool Equals(Force other, double tolerance, ComparisonType comparisonType) [Obsolete("Please use the Equals(Force, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(Force other, Force maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs index 0290b164b3..10eba4da08 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs @@ -730,7 +730,7 @@ public override bool Equals(object obj) return false; var objQuantity = (ForceChangeRate)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -795,7 +795,7 @@ public bool Equals(ForceChangeRate other, double tolerance, ComparisonType compa [Obsolete("Please use the Equals(ForceChangeRate, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(ForceChangeRate other, ForceChangeRate maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs index a67b097725..aa7b93db39 100644 --- a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs @@ -664,7 +664,7 @@ public override bool Equals(object obj) return false; var objQuantity = (ForcePerLength)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -729,7 +729,7 @@ public bool Equals(ForcePerLength other, double tolerance, ComparisonType compar [Obsolete("Please use the Equals(ForcePerLength, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(ForcePerLength other, ForcePerLength maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs b/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs index a347db89cc..fd01273ce1 100644 --- a/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs @@ -631,7 +631,7 @@ public override bool Equals(object obj) return false; var objQuantity = (Frequency)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -696,7 +696,7 @@ public bool Equals(Frequency other, double tolerance, ComparisonType comparisonT [Obsolete("Please use the Equals(Frequency, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(Frequency other, Frequency maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs index e229c62a64..fa451358f4 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs @@ -895,7 +895,7 @@ public override bool Equals(object obj) return false; var objQuantity = (HeatFlux)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -960,7 +960,7 @@ public bool Equals(HeatFlux other, double tolerance, ComparisonType comparisonTy [Obsolete("Please use the Equals(HeatFlux, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(HeatFlux other, HeatFlux maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs index 3e868e1f8f..07e4cf1285 100644 --- a/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/HeatTransferCoefficient.g.cs @@ -433,7 +433,7 @@ public override bool Equals(object obj) return false; var objQuantity = (HeatTransferCoefficient)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -498,7 +498,7 @@ public bool Equals(HeatTransferCoefficient other, double tolerance, ComparisonTy [Obsolete("Please use the Equals(HeatTransferCoefficient, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(HeatTransferCoefficient other, HeatTransferCoefficient maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs b/UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs index 452c2d3644..2dbf2da1ff 100644 --- a/UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs @@ -499,7 +499,7 @@ public override bool Equals(object obj) return false; var objQuantity = (Illuminance)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -564,7 +564,7 @@ public bool Equals(Illuminance other, double tolerance, ComparisonType compariso [Obsolete("Please use the Equals(Illuminance, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(Illuminance other, Illuminance maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/Information.g.cs b/UnitsNet/GeneratedCode/Quantities/Information.g.cs index 24adb6ba13..b693c4d80b 100644 --- a/UnitsNet/GeneratedCode/Quantities/Information.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Information.g.cs @@ -1212,7 +1212,7 @@ public override bool Equals(object obj) return false; var objQuantity = (Information)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -1277,7 +1277,7 @@ public bool Equals(Information other, double tolerance, ComparisonType compariso [Obsolete("Please use the Equals(Information, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(Information other, Information maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs index 91c36d79c4..9bede64991 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs @@ -433,7 +433,7 @@ public override bool Equals(object obj) return false; var objQuantity = (Irradiance)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -498,7 +498,7 @@ public bool Equals(Irradiance other, double tolerance, ComparisonType comparison [Obsolete("Please use the Equals(Irradiance, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(Irradiance other, Irradiance maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs b/UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs index f99a0792eb..fcf3261e33 100644 --- a/UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs @@ -466,7 +466,7 @@ public override bool Equals(object obj) return false; var objQuantity = (Irradiation)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -531,7 +531,7 @@ public bool Equals(Irradiation other, double tolerance, ComparisonType compariso [Obsolete("Please use the Equals(Irradiation, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(Irradiation other, Irradiation maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs index 4ddcf3eadc..98c0993ae3 100644 --- a/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/KinematicViscosity.g.cs @@ -631,7 +631,7 @@ public override bool Equals(object obj) return false; var objQuantity = (KinematicViscosity)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -696,7 +696,7 @@ public bool Equals(KinematicViscosity other, double tolerance, ComparisonType co [Obsolete("Please use the Equals(KinematicViscosity, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(KinematicViscosity other, KinematicViscosity maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/LapseRate.g.cs b/UnitsNet/GeneratedCode/Quantities/LapseRate.g.cs index b79f0b19e8..659b0bf709 100644 --- a/UnitsNet/GeneratedCode/Quantities/LapseRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LapseRate.g.cs @@ -400,7 +400,7 @@ public override bool Equals(object obj) return false; var objQuantity = (LapseRate)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -465,7 +465,7 @@ public bool Equals(LapseRate other, double tolerance, ComparisonType comparisonT [Obsolete("Please use the Equals(LapseRate, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(LapseRate other, LapseRate maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/Length.g.cs b/UnitsNet/GeneratedCode/Quantities/Length.g.cs index e5d646d5f2..abbaba0aa7 100644 --- a/UnitsNet/GeneratedCode/Quantities/Length.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Length.g.cs @@ -1093,7 +1093,7 @@ public override bool Equals(object obj) return false; var objQuantity = (Length)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -1158,7 +1158,7 @@ public bool Equals(Length other, double tolerance, ComparisonType comparisonType [Obsolete("Please use the Equals(Length, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(Length other, Length maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/Level.g.cs b/UnitsNet/GeneratedCode/Quantities/Level.g.cs index fd31b4fbc8..0fac5e2dec 100644 --- a/UnitsNet/GeneratedCode/Quantities/Level.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Level.g.cs @@ -431,7 +431,7 @@ public override bool Equals(object obj) return false; var objQuantity = (Level)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -496,7 +496,7 @@ public bool Equals(Level other, double tolerance, ComparisonType comparisonType) [Obsolete("Please use the Equals(Level, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(Level other, Level maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs index 55fa06a289..a8c85dd4ba 100644 --- a/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LinearDensity.g.cs @@ -466,7 +466,7 @@ public override bool Equals(object obj) return false; var objQuantity = (LinearDensity)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -531,7 +531,7 @@ public bool Equals(LinearDensity other, double tolerance, ComparisonType compari [Obsolete("Please use the Equals(LinearDensity, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(LinearDensity other, LinearDensity maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.g.cs index b1ff7963e3..4a9a87cd5c 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousFlux.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousFlux.g.cs @@ -400,7 +400,7 @@ public override bool Equals(object obj) return false; var objQuantity = (LuminousFlux)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -465,7 +465,7 @@ public bool Equals(LuminousFlux other, double tolerance, ComparisonType comparis [Obsolete("Please use the Equals(LuminousFlux, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(LuminousFlux other, LuminousFlux maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs index e82bf9ff88..b3e841f26e 100644 --- a/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/LuminousIntensity.g.cs @@ -400,7 +400,7 @@ public override bool Equals(object obj) return false; var objQuantity = (LuminousIntensity)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -465,7 +465,7 @@ public bool Equals(LuminousIntensity other, double tolerance, ComparisonType com [Obsolete("Please use the Equals(LuminousIntensity, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(LuminousIntensity other, LuminousIntensity maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticField.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticField.g.cs index 8e00112885..b08fc8caa6 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticField.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticField.g.cs @@ -400,7 +400,7 @@ public override bool Equals(object obj) return false; var objQuantity = (MagneticField)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -465,7 +465,7 @@ public bool Equals(MagneticField other, double tolerance, ComparisonType compari [Obsolete("Please use the Equals(MagneticField, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(MagneticField other, MagneticField maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.g.cs index 22636a7afd..6a904b16f3 100644 --- a/UnitsNet/GeneratedCode/Quantities/MagneticFlux.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MagneticFlux.g.cs @@ -400,7 +400,7 @@ public override bool Equals(object obj) return false; var objQuantity = (MagneticFlux)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -465,7 +465,7 @@ public bool Equals(MagneticFlux other, double tolerance, ComparisonType comparis [Obsolete("Please use the Equals(MagneticFlux, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(MagneticFlux other, MagneticFlux maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/Magnetization.g.cs b/UnitsNet/GeneratedCode/Quantities/Magnetization.g.cs index 4c5a5fa9cd..4de15faad6 100644 --- a/UnitsNet/GeneratedCode/Quantities/Magnetization.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Magnetization.g.cs @@ -400,7 +400,7 @@ public override bool Equals(object obj) return false; var objQuantity = (Magnetization)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -465,7 +465,7 @@ public bool Equals(Magnetization other, double tolerance, ComparisonType compari [Obsolete("Please use the Equals(Magnetization, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(Magnetization other, Magnetization maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/Mass.g.cs b/UnitsNet/GeneratedCode/Quantities/Mass.g.cs index 2b2e94c5b6..5033e87f40 100644 --- a/UnitsNet/GeneratedCode/Quantities/Mass.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Mass.g.cs @@ -1060,7 +1060,7 @@ public override bool Equals(object obj) return false; var objQuantity = (Mass)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -1125,7 +1125,7 @@ public bool Equals(Mass other, double tolerance, ComparisonType comparisonType) [Obsolete("Please use the Equals(Mass, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(Mass other, Mass maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs index d37f953ce5..ec413d70e6 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlow.g.cs @@ -862,7 +862,7 @@ public override bool Equals(object obj) return false; var objQuantity = (MassFlow)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -927,7 +927,7 @@ public bool Equals(MassFlow other, double tolerance, ComparisonType comparisonTy [Obsolete("Please use the Equals(MassFlow, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(MassFlow other, MassFlow maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs b/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs index 43c0abf553..25d27e982a 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassFlux.g.cs @@ -433,7 +433,7 @@ public override bool Equals(object obj) return false; var objQuantity = (MassFlux)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -498,7 +498,7 @@ public bool Equals(MassFlux other, double tolerance, ComparisonType comparisonTy [Obsolete("Please use the Equals(MassFlux, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(MassFlux other, MassFlux maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.g.cs b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.g.cs index 855753df2b..4d06f34b7d 100644 --- a/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MassMomentOfInertia.g.cs @@ -1225,7 +1225,7 @@ public override bool Equals(object obj) return false; var objQuantity = (MassMomentOfInertia)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -1290,7 +1290,7 @@ public bool Equals(MassMomentOfInertia other, double tolerance, ComparisonType c [Obsolete("Please use the Equals(MassMomentOfInertia, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(MassMomentOfInertia other, MassMomentOfInertia maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.g.cs index db04927f65..926c9ae9a4 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEnergy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEnergy.g.cs @@ -466,7 +466,7 @@ public override bool Equals(object obj) return false; var objQuantity = (MolarEnergy)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -531,7 +531,7 @@ public bool Equals(MolarEnergy other, double tolerance, ComparisonType compariso [Obsolete("Please use the Equals(MolarEnergy, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(MolarEnergy other, MolarEnergy maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.g.cs index 6f20506966..b9dbef2225 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarEntropy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarEntropy.g.cs @@ -466,7 +466,7 @@ public override bool Equals(object obj) return false; var objQuantity = (MolarEntropy)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -531,7 +531,7 @@ public bool Equals(MolarEntropy other, double tolerance, ComparisonType comparis [Obsolete("Please use the Equals(MolarEntropy, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(MolarEntropy other, MolarEntropy maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs b/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs index 8943f7abe2..2cf49ac315 100644 --- a/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/MolarMass.g.cs @@ -763,7 +763,7 @@ public override bool Equals(object obj) return false; var objQuantity = (MolarMass)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -828,7 +828,7 @@ public bool Equals(MolarMass other, double tolerance, ComparisonType comparisonT [Obsolete("Please use the Equals(MolarMass, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(MolarMass other, MolarMass maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs b/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs index 6310c200f9..937272859e 100644 --- a/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Molarity.g.cs @@ -631,7 +631,7 @@ public override bool Equals(object obj) return false; var objQuantity = (Molarity)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -696,7 +696,7 @@ public bool Equals(Molarity other, double tolerance, ComparisonType comparisonTy [Obsolete("Please use the Equals(Molarity, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(Molarity other, Molarity maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/Permeability.g.cs b/UnitsNet/GeneratedCode/Quantities/Permeability.g.cs index 18be19f661..1f62c80362 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permeability.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permeability.g.cs @@ -400,7 +400,7 @@ public override bool Equals(object obj) return false; var objQuantity = (Permeability)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -465,7 +465,7 @@ public bool Equals(Permeability other, double tolerance, ComparisonType comparis [Obsolete("Please use the Equals(Permeability, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(Permeability other, Permeability maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/Permittivity.g.cs b/UnitsNet/GeneratedCode/Quantities/Permittivity.g.cs index 620d851560..a62c9ba5da 100644 --- a/UnitsNet/GeneratedCode/Quantities/Permittivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Permittivity.g.cs @@ -400,7 +400,7 @@ public override bool Equals(object obj) return false; var objQuantity = (Permittivity)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -465,7 +465,7 @@ public bool Equals(Permittivity other, double tolerance, ComparisonType comparis [Obsolete("Please use the Equals(Permittivity, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(Permittivity other, Permittivity maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/Power.g.cs b/UnitsNet/GeneratedCode/Quantities/Power.g.cs index b14da84b78..6935a8fb34 100644 --- a/UnitsNet/GeneratedCode/Quantities/Power.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Power.g.cs @@ -1024,7 +1024,7 @@ public override bool Equals(object obj) return false; var objQuantity = (Power)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -1089,7 +1089,7 @@ public bool Equals(Power other, double tolerance, ComparisonType comparisonType) [Obsolete("Please use the Equals(Power, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(Power other, Power maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs index ffa495758f..fc71c953c2 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerDensity.g.cs @@ -1819,7 +1819,7 @@ public override bool Equals(object obj) return false; var objQuantity = (PowerDensity)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -1884,7 +1884,7 @@ public bool Equals(PowerDensity other, double tolerance, ComparisonType comparis [Obsolete("Please use the Equals(PowerDensity, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(PowerDensity other, PowerDensity maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/PowerRatio.g.cs b/UnitsNet/GeneratedCode/Quantities/PowerRatio.g.cs index 60f86bd2dd..151a675c56 100644 --- a/UnitsNet/GeneratedCode/Quantities/PowerRatio.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PowerRatio.g.cs @@ -431,7 +431,7 @@ public override bool Equals(object obj) return false; var objQuantity = (PowerRatio)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -496,7 +496,7 @@ public bool Equals(PowerRatio other, double tolerance, ComparisonType comparison [Obsolete("Please use the Equals(PowerRatio, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(PowerRatio other, PowerRatio maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs b/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs index 4d0abb7ff4..b8a07f88fc 100644 --- a/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Pressure.g.cs @@ -1622,7 +1622,7 @@ public override bool Equals(object obj) return false; var objQuantity = (Pressure)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -1687,7 +1687,7 @@ public bool Equals(Pressure other, double tolerance, ComparisonType comparisonTy [Obsolete("Please use the Equals(Pressure, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(Pressure other, Pressure maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs index 7aaf862f01..1e86e0e840 100644 --- a/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/PressureChangeRate.g.cs @@ -499,7 +499,7 @@ public override bool Equals(object obj) return false; var objQuantity = (PressureChangeRate)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -564,7 +564,7 @@ public bool Equals(PressureChangeRate other, double tolerance, ComparisonType co [Obsolete("Please use the Equals(PressureChangeRate, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(PressureChangeRate other, PressureChangeRate maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs b/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs index cb9b0159b3..b71e2d5698 100644 --- a/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Ratio.g.cs @@ -555,7 +555,7 @@ public override bool Equals(object obj) return false; var objQuantity = (Ratio)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -620,7 +620,7 @@ public bool Equals(Ratio other, double tolerance, ComparisonType comparisonType) [Obsolete("Please use the Equals(Ratio, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(Ratio other, Ratio maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.g.cs index 33abd50885..536a517e5c 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactiveEnergy.g.cs @@ -466,7 +466,7 @@ public override bool Equals(object obj) return false; var objQuantity = (ReactiveEnergy)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -531,7 +531,7 @@ public bool Equals(ReactiveEnergy other, double tolerance, ComparisonType compar [Obsolete("Please use the Equals(ReactiveEnergy, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(ReactiveEnergy other, ReactiveEnergy maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/ReactivePower.g.cs b/UnitsNet/GeneratedCode/Quantities/ReactivePower.g.cs index 8969dd8393..0e7ff79099 100644 --- a/UnitsNet/GeneratedCode/Quantities/ReactivePower.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ReactivePower.g.cs @@ -499,7 +499,7 @@ public override bool Equals(object obj) return false; var objQuantity = (ReactivePower)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -564,7 +564,7 @@ public bool Equals(ReactivePower other, double tolerance, ComparisonType compari [Obsolete("Please use the Equals(ReactivePower, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(ReactivePower other, ReactivePower maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.g.cs index 55606e0b14..8c921b73e1 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalAcceleration.g.cs @@ -466,7 +466,7 @@ public override bool Equals(object obj) return false; var objQuantity = (RotationalAcceleration)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -531,7 +531,7 @@ public bool Equals(RotationalAcceleration other, double tolerance, ComparisonTyp [Obsolete("Please use the Equals(RotationalAcceleration, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(RotationalAcceleration other, RotationalAcceleration maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs index 075eee6087..d62e8396b9 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalSpeed.g.cs @@ -796,7 +796,7 @@ public override bool Equals(object obj) return false; var objQuantity = (RotationalSpeed)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -861,7 +861,7 @@ public bool Equals(RotationalSpeed other, double tolerance, ComparisonType compa [Obsolete("Please use the Equals(RotationalSpeed, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(RotationalSpeed other, RotationalSpeed maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs index 398916ea6c..72d846ef40 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffness.g.cs @@ -466,7 +466,7 @@ public override bool Equals(object obj) return false; var objQuantity = (RotationalStiffness)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -531,7 +531,7 @@ public bool Equals(RotationalStiffness other, double tolerance, ComparisonType c [Obsolete("Please use the Equals(RotationalStiffness, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(RotationalStiffness other, RotationalStiffness maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs index 6d28e8ca15..4427ced87c 100644 --- a/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/RotationalStiffnessPerLength.g.cs @@ -466,7 +466,7 @@ public override bool Equals(object obj) return false; var objQuantity = (RotationalStiffnessPerLength)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -531,7 +531,7 @@ public bool Equals(RotationalStiffnessPerLength other, double tolerance, Compari [Obsolete("Please use the Equals(RotationalStiffnessPerLength, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(RotationalStiffnessPerLength other, RotationalStiffnessPerLength maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/SolidAngle.g.cs b/UnitsNet/GeneratedCode/Quantities/SolidAngle.g.cs index d8290110cc..a99086abb9 100644 --- a/UnitsNet/GeneratedCode/Quantities/SolidAngle.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SolidAngle.g.cs @@ -390,7 +390,7 @@ public override bool Equals(object obj) return false; var objQuantity = (SolidAngle)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -455,7 +455,7 @@ public bool Equals(SolidAngle other, double tolerance, ComparisonType comparison [Obsolete("Please use the Equals(SolidAngle, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(SolidAngle other, SolidAngle maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs index 9844f68e56..25b3e32f74 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEnergy.g.cs @@ -631,7 +631,7 @@ public override bool Equals(object obj) return false; var objQuantity = (SpecificEnergy)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -696,7 +696,7 @@ public bool Equals(SpecificEnergy other, double tolerance, ComparisonType compar [Obsolete("Please use the Equals(SpecificEnergy, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(SpecificEnergy other, SpecificEnergy maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs index 238e4a2883..84572cddf5 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificEntropy.g.cs @@ -631,7 +631,7 @@ public override bool Equals(object obj) return false; var objQuantity = (SpecificEntropy)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -696,7 +696,7 @@ public bool Equals(SpecificEntropy other, double tolerance, ComparisonType compa [Obsolete("Please use the Equals(SpecificEntropy, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(SpecificEntropy other, SpecificEntropy maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs index 6a062d2d8f..745a0c844f 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs @@ -400,7 +400,7 @@ public override bool Equals(object obj) return false; var objQuantity = (SpecificVolume)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -465,7 +465,7 @@ public bool Equals(SpecificVolume other, double tolerance, ComparisonType compar [Obsolete("Please use the Equals(SpecificVolume, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(SpecificVolume other, SpecificVolume maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs index 9f3f654bc0..e5008413dd 100644 --- a/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/SpecificWeight.g.cs @@ -928,7 +928,7 @@ public override bool Equals(object obj) return false; var objQuantity = (SpecificWeight)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -993,7 +993,7 @@ public bool Equals(SpecificWeight other, double tolerance, ComparisonType compar [Obsolete("Please use the Equals(SpecificWeight, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(SpecificWeight other, SpecificWeight maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/Speed.g.cs b/UnitsNet/GeneratedCode/Quantities/Speed.g.cs index 255d0352aa..8c4a1409a3 100644 --- a/UnitsNet/GeneratedCode/Quantities/Speed.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Speed.g.cs @@ -1423,7 +1423,7 @@ public override bool Equals(object obj) return false; var objQuantity = (Speed)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -1488,7 +1488,7 @@ public bool Equals(Speed other, double tolerance, ComparisonType comparisonType) [Obsolete("Please use the Equals(Speed, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(Speed other, Speed maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/Temperature.g.cs b/UnitsNet/GeneratedCode/Quantities/Temperature.g.cs index 955080c461..16c5c1ef86 100644 --- a/UnitsNet/GeneratedCode/Quantities/Temperature.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Temperature.g.cs @@ -589,7 +589,7 @@ public override bool Equals(object obj) return false; var objQuantity = (Temperature)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -654,7 +654,7 @@ public bool Equals(Temperature other, double tolerance, ComparisonType compariso [Obsolete("Please use the Equals(Temperature, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(Temperature other, Temperature maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.g.cs index 2f40e75162..601ea0c024 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureChangeRate.g.cs @@ -697,7 +697,7 @@ public override bool Equals(object obj) return false; var objQuantity = (TemperatureChangeRate)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -762,7 +762,7 @@ public bool Equals(TemperatureChangeRate other, double tolerance, ComparisonType [Obsolete("Please use the Equals(TemperatureChangeRate, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(TemperatureChangeRate other, TemperatureChangeRate maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs index b97d3dc36a..ed8396e3f5 100644 --- a/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/TemperatureDelta.g.cs @@ -893,7 +893,7 @@ public override bool Equals(object obj) return false; var objQuantity = (TemperatureDelta)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -958,7 +958,7 @@ public bool Equals(TemperatureDelta other, double tolerance, ComparisonType comp [Obsolete("Please use the Equals(TemperatureDelta, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(TemperatureDelta other, TemperatureDelta maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.g.cs index 52a7d56f32..b0bcc7bcfb 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalConductivity.g.cs @@ -433,7 +433,7 @@ public override bool Equals(object obj) return false; var objQuantity = (ThermalConductivity)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -498,7 +498,7 @@ public bool Equals(ThermalConductivity other, double tolerance, ComparisonType c [Obsolete("Please use the Equals(ThermalConductivity, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(ThermalConductivity other, ThermalConductivity maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.g.cs b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.g.cs index d1757d9add..c16a369618 100644 --- a/UnitsNet/GeneratedCode/Quantities/ThermalResistance.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/ThermalResistance.g.cs @@ -532,7 +532,7 @@ public override bool Equals(object obj) return false; var objQuantity = (ThermalResistance)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -597,7 +597,7 @@ public bool Equals(ThermalResistance other, double tolerance, ComparisonType com [Obsolete("Please use the Equals(ThermalResistance, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(ThermalResistance other, ThermalResistance maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/Torque.g.cs b/UnitsNet/GeneratedCode/Quantities/Torque.g.cs index 28ce1f85e9..eaa258f747 100644 --- a/UnitsNet/GeneratedCode/Quantities/Torque.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Torque.g.cs @@ -1060,7 +1060,7 @@ public override bool Equals(object obj) return false; var objQuantity = (Torque)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -1125,7 +1125,7 @@ public bool Equals(Torque other, double tolerance, ComparisonType comparisonType [Obsolete("Please use the Equals(Torque, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(Torque other, Torque maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/VitaminA.g.cs b/UnitsNet/GeneratedCode/Quantities/VitaminA.g.cs index 64957ddb07..71cc9f9d48 100644 --- a/UnitsNet/GeneratedCode/Quantities/VitaminA.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VitaminA.g.cs @@ -390,7 +390,7 @@ public override bool Equals(object obj) return false; var objQuantity = (VitaminA)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -455,7 +455,7 @@ public bool Equals(VitaminA other, double tolerance, ComparisonType comparisonTy [Obsolete("Please use the Equals(VitaminA, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(VitaminA other, VitaminA maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/Volume.g.cs b/UnitsNet/GeneratedCode/Quantities/Volume.g.cs index 92681a5607..503b5698f1 100644 --- a/UnitsNet/GeneratedCode/Quantities/Volume.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/Volume.g.cs @@ -1821,7 +1821,7 @@ public override bool Equals(object obj) return false; var objQuantity = (Volume)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -1886,7 +1886,7 @@ public bool Equals(Volume other, double tolerance, ComparisonType comparisonType [Obsolete("Please use the Equals(Volume, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(Volume other, Volume maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs index 1021e43a37..a4f7678203 100644 --- a/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs +++ b/UnitsNet/GeneratedCode/Quantities/VolumeFlow.g.cs @@ -1159,7 +1159,7 @@ public override bool Equals(object obj) return false; var objQuantity = (VolumeFlow)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -1224,7 +1224,7 @@ public bool Equals(VolumeFlow other, double tolerance, ComparisonType comparison [Obsolete("Please use the Equals(VolumeFlow, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals(VolumeFlow other, VolumeFlow maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode() diff --git a/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 b/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 index 41173bfc47..3e69616593 100644 --- a/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 +++ b/UnitsNet/Scripts/Include-GenerateQuantitySourceCode.ps1 @@ -467,7 +467,7 @@ namespace UnitsNet return false; var objQuantity = ($quantityName)obj; - return this.Value.Equals(objQuantity.AsBaseNumericType(this.Unit)); + return _value.Equals(objQuantity.AsBaseNumericType(this.Unit)); } /// @@ -532,7 +532,7 @@ namespace UnitsNet [Obsolete("Please use the Equals($quantityName, double, ComparisonType) overload. This method will be removed in a future version.")] public bool Equals($quantityName other, $quantityName maxError) { - return Math.Abs(this.Value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); + return Math.Abs(_value - other.AsBaseNumericType(this.Unit)) <= maxError.AsBaseNumericType(this.Unit); } public override int GetHashCode()