Skip to content

Commit

Permalink
✨ Add IEquatableQuantity
Browse files Browse the repository at this point in the history
Ref #1193

In v5, equality changed to strict equality.
This meant it became more cumbersome to compare equality for `IQuantity` objects of different units, but similar value when converted to the same unit.

- Add interface `IEquatableQuantity` to help compare `IQuantity` objects with a tolerance for error
  • Loading branch information
angularsen committed Feb 26, 2023
1 parent f13d5f8 commit 70fe940
Show file tree
Hide file tree
Showing 120 changed files with 171 additions and 0 deletions.
1 change: 1 addition & 0 deletions CodeGen/Generators/UnitsNetGen/QuantityGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ namespace UnitsNet
IComparable<{_quantity.Name}>,
IConvertible,
IEquatable<{_quantity.Name}>,
IEquatableQuantity<{_quantity.Name}>,
IFormattable");

Writer.WL($@"
Expand Down
1 change: 1 addition & 0 deletions UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions UnitsNet/GeneratedCode/Quantities/Angle.g.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions UnitsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions UnitsNet/GeneratedCode/Quantities/Area.g.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions UnitsNet/GeneratedCode/Quantities/BitRate.g.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions UnitsNet/GeneratedCode/Quantities/Capacitance.g.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions UnitsNet/GeneratedCode/Quantities/Compressibility.g.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions UnitsNet/GeneratedCode/Quantities/Density.g.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions UnitsNet/GeneratedCode/Quantities/Duration.g.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.g.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.g.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions UnitsNet/GeneratedCode/Quantities/Energy.g.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions UnitsNet/GeneratedCode/Quantities/EnergyDensity.g.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions UnitsNet/GeneratedCode/Quantities/Entropy.g.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions UnitsNet/GeneratedCode/Quantities/Force.g.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions UnitsNet/GeneratedCode/Quantities/Frequency.g.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions UnitsNet/GeneratedCode/Quantities/FuelEfficiency.g.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions UnitsNet/GeneratedCode/Quantities/HeatFlux.g.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions UnitsNet/GeneratedCode/Quantities/Illuminance.g.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions UnitsNet/GeneratedCode/Quantities/Impulse.g.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions UnitsNet/GeneratedCode/Quantities/Information.g.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions UnitsNet/GeneratedCode/Quantities/Irradiance.g.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions UnitsNet/GeneratedCode/Quantities/Irradiation.g.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 70fe940

Please sign in to comment.