diff --git a/CodeGen/Generators/UnitsNetGen/QuantityGenerator.cs b/CodeGen/Generators/UnitsNetGen/QuantityGenerator.cs
index c4b7825a47..b4c1faea65 100644
--- a/CodeGen/Generators/UnitsNetGen/QuantityGenerator.cs
+++ b/CodeGen/Generators/UnitsNetGen/QuantityGenerator.cs
@@ -64,7 +64,7 @@ namespace UnitsNet
Writer.WLIfText(1, GetObsoleteAttributeOrNull(_quantity));
Writer.W(@$"
[DataContract]
- public readonly partial struct {_quantity.Name} : IQuantity<{_unitEnumName}>, ");
+ public readonly partial struct {_quantity.Name} : {(_quantity.GenerateArithmetic ? "IArithmeticQuantity" : "IQuantity")}<{_quantity.Name}, {_unitEnumName}, {_quantity.ValueType}>, ");
if (_quantity.ValueType == "decimal")
{
Writer.W("IDecimalQuantity, ");
@@ -239,9 +239,19 @@ private void GenerateStaticProperties()
/// Gets an instance of this quantity with a value of 0 in the base unit {_quantity.BaseUnit}.
///
public static {_quantity.Name} Zero {{ get; }}
+");
- #endregion
+ if (_quantity.GenerateArithmetic)
+ {
+ Writer.WL($@"
+ ///
+ public static {_quantity.Name} AdditiveIdentity => Zero;
");
+ }
+
+ Writer.WL($@"
+ #endregion
+ ");
}
private void GenerateProperties()
diff --git a/UnitsNet.Tests/GenericMathExtensionsTests.cs b/UnitsNet.Tests/GenericMathExtensionsTests.cs
new file mode 100644
index 0000000000..cea65470bb
--- /dev/null
+++ b/UnitsNet.Tests/GenericMathExtensionsTests.cs
@@ -0,0 +1,37 @@
+// Licensed under MIT No Attribution, see LICENSE file at the root.
+// Copyright 2013 Andreas Gullberg Larsen (andreas.larsen84@gmail.com). Maintained at https://github.com/angularsen/UnitsNet.
+
+#if NET7_0_OR_GREATER
+using UnitsNet.GenericMath;
+using Xunit;
+
+namespace UnitsNet.Tests;
+
+public class GenericMathExtensionsTests
+{
+ [Fact]
+ public void CanCalcSum()
+ {
+ Length[] values = { Length.FromCentimeters(100), Length.FromCentimeters(200) };
+
+ Assert.Equal(Length.FromCentimeters(300), values.Sum());
+ }
+
+ [Fact]
+ public void CanCalcAverage_ForQuantitiesWithDoubleValueType()
+ {
+ Length[] values = { Length.FromCentimeters(100), Length.FromCentimeters(200) };
+
+ Assert.Equal(Length.FromCentimeters(150), values.Average());
+ }
+
+ [Fact]
+ public void CanCalcAverage_ForQuantitiesWithDecimalValueType()
+ {
+ Information[] values = { Information.FromBytes(100), Information.FromBytes(200) };
+
+ Assert.Equal(Information.FromBytes(150), values.Average());
+ }
+}
+
+#endif
diff --git a/UnitsNet.Tests/UnitsNet.Tests.csproj b/UnitsNet.Tests/UnitsNet.Tests.csproj
index 01444d706d..67cd43b1de 100644
--- a/UnitsNet.Tests/UnitsNet.Tests.csproj
+++ b/UnitsNet.Tests/UnitsNet.Tests.csproj
@@ -1,7 +1,7 @@
- net6.0;net48
+ net7.0;net48
latest
true
CS0618
diff --git a/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs b/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs
index 10a9c1a3f3..71dcfc67d5 100644
--- a/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs
+++ b/UnitsNet/GeneratedCode/Quantities/Acceleration.g.cs
@@ -36,7 +36,7 @@ namespace UnitsNet
/// Acceleration, in physics, is the rate at which the velocity of an object changes over time. An object's acceleration is the net result of any and all forces acting on the object, as described by Newton's Second Law. The SI unit for acceleration is the Meter per second squared (m/s²). Accelerations are vector quantities (they have magnitude and direction) and add according to the parallelogram law. As a vector, the calculated net force is equal to the product of the object's mass (a scalar quantity) and the acceleration.
///
[DataContract]
- public readonly partial struct Acceleration : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
+ public readonly partial struct Acceleration : IArithmeticQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
{
///
/// The numeric value this quantity was constructed with.
@@ -141,8 +141,11 @@ public Acceleration(double value, UnitSystem unitSystem)
///
public static Acceleration Zero { get; }
- #endregion
+ ///
+ public static Acceleration AdditiveIdentity => Zero;
+ #endregion
+
#region Properties
///
diff --git a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs
index 01f9115756..eea0e12d3b 100644
--- a/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs
+++ b/UnitsNet/GeneratedCode/Quantities/AmountOfSubstance.g.cs
@@ -36,7 +36,7 @@ namespace UnitsNet
/// Mole is the amount of substance containing Avagadro's Number (6.02 x 10 ^ 23) of real particles such as molecules,atoms, ions or radicals.
///
[DataContract]
- public readonly partial struct AmountOfSubstance : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
+ public readonly partial struct AmountOfSubstance : IArithmeticQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
{
///
/// The numeric value this quantity was constructed with.
@@ -142,8 +142,11 @@ public AmountOfSubstance(double value, UnitSystem unitSystem)
///
public static AmountOfSubstance Zero { get; }
- #endregion
+ ///
+ public static AmountOfSubstance AdditiveIdentity => Zero;
+ #endregion
+
#region Properties
///
diff --git a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs
index 5d9c147ee0..6b68414b1f 100644
--- a/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs
+++ b/UnitsNet/GeneratedCode/Quantities/AmplitudeRatio.g.cs
@@ -36,7 +36,7 @@ namespace UnitsNet
/// The strength of a signal expressed in decibels (dB) relative to one volt RMS.
///
[DataContract]
- public readonly partial struct AmplitudeRatio : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
+ public readonly partial struct AmplitudeRatio : IArithmeticQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
{
///
/// The numeric value this quantity was constructed with.
@@ -131,8 +131,11 @@ public AmplitudeRatio(double value, UnitSystem unitSystem)
///
public static AmplitudeRatio Zero { get; }
- #endregion
+ ///
+ public static AmplitudeRatio AdditiveIdentity => Zero;
+ #endregion
+
#region Properties
///
diff --git a/UnitsNet/GeneratedCode/Quantities/Angle.g.cs b/UnitsNet/GeneratedCode/Quantities/Angle.g.cs
index 35dbb2a5ac..61e25c4196 100644
--- a/UnitsNet/GeneratedCode/Quantities/Angle.g.cs
+++ b/UnitsNet/GeneratedCode/Quantities/Angle.g.cs
@@ -36,7 +36,7 @@ namespace UnitsNet
/// In geometry, an angle is the figure formed by two rays, called the sides of the angle, sharing a common endpoint, called the vertex of the angle.
///
[DataContract]
- public readonly partial struct Angle : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
+ public readonly partial struct Angle : IArithmeticQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
{
///
/// The numeric value this quantity was constructed with.
@@ -143,8 +143,11 @@ public Angle(double value, UnitSystem unitSystem)
///
public static Angle Zero { get; }
- #endregion
+ ///
+ public static Angle AdditiveIdentity => Zero;
+ #endregion
+
#region Properties
///
diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs
index 834b66a4f2..ce9917baa2 100644
--- a/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs
+++ b/UnitsNet/GeneratedCode/Quantities/ApparentEnergy.g.cs
@@ -36,7 +36,7 @@ namespace UnitsNet
/// A unit for expressing the integral of apparent power over time, equal to the product of 1 volt-ampere and 1 hour, or to 3600 joules.
///
[DataContract]
- public readonly partial struct ApparentEnergy : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
+ public readonly partial struct ApparentEnergy : IArithmeticQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
{
///
/// The numeric value this quantity was constructed with.
@@ -130,8 +130,11 @@ public ApparentEnergy(double value, UnitSystem unitSystem)
///
public static ApparentEnergy Zero { get; }
- #endregion
+ ///
+ public static ApparentEnergy AdditiveIdentity => Zero;
+ #endregion
+
#region Properties
///
diff --git a/UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs b/UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs
index 8653aa4575..52e2285088 100644
--- a/UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs
+++ b/UnitsNet/GeneratedCode/Quantities/ApparentPower.g.cs
@@ -36,7 +36,7 @@ namespace UnitsNet
/// Power engineers measure apparent power as the magnitude of the vector sum of active and reactive power. Apparent power is the product of the root-mean-square of voltage and current.
///
[DataContract]
- public readonly partial struct ApparentPower : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
+ public readonly partial struct ApparentPower : IArithmeticQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
{
///
/// The numeric value this quantity was constructed with.
@@ -131,8 +131,11 @@ public ApparentPower(double value, UnitSystem unitSystem)
///
public static ApparentPower Zero { get; }
- #endregion
+ ///
+ public static ApparentPower AdditiveIdentity => Zero;
+ #endregion
+
#region Properties
///
diff --git a/UnitsNet/GeneratedCode/Quantities/Area.g.cs b/UnitsNet/GeneratedCode/Quantities/Area.g.cs
index dd71c089bc..0a00e2550f 100644
--- a/UnitsNet/GeneratedCode/Quantities/Area.g.cs
+++ b/UnitsNet/GeneratedCode/Quantities/Area.g.cs
@@ -36,7 +36,7 @@ namespace UnitsNet
/// Area is a quantity that expresses the extent of a two-dimensional surface or shape, or planar lamina, in the plane. Area can be understood as the amount of material with a given thickness that would be necessary to fashion a model of the shape, or the amount of paint necessary to cover the surface with a single coat.[1] It is the two-dimensional analog of the length of a curve (a one-dimensional concept) or the volume of a solid (a three-dimensional concept).
///
[DataContract]
- public readonly partial struct Area : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
+ public readonly partial struct Area : IArithmeticQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
{
///
/// The numeric value this quantity was constructed with.
@@ -141,8 +141,11 @@ public Area(double value, UnitSystem unitSystem)
///
public static Area Zero { get; }
- #endregion
+ ///
+ public static Area AdditiveIdentity => Zero;
+ #endregion
+
#region Properties
///
diff --git a/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs
index 20dfd4d304..6cbbe45cd7 100644
--- a/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs
+++ b/UnitsNet/GeneratedCode/Quantities/AreaDensity.g.cs
@@ -36,7 +36,7 @@ namespace UnitsNet
/// The area density of a two-dimensional object is calculated as the mass per unit area. For paper this is also called grammage.
///
[DataContract]
- public readonly partial struct AreaDensity : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
+ public readonly partial struct AreaDensity : IArithmeticQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
{
///
/// The numeric value this quantity was constructed with.
@@ -130,8 +130,11 @@ public AreaDensity(double value, UnitSystem unitSystem)
///
public static AreaDensity Zero { get; }
- #endregion
+ ///
+ public static AreaDensity AdditiveIdentity => Zero;
+ #endregion
+
#region Properties
///
diff --git a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs
index 4e6e567989..d6577e5d30 100644
--- a/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs
+++ b/UnitsNet/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs
@@ -36,7 +36,7 @@ namespace UnitsNet
/// A geometric property of an area that reflects how its points are distributed with regard to an axis.
///
[DataContract]
- public readonly partial struct AreaMomentOfInertia : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
+ public readonly partial struct AreaMomentOfInertia : IArithmeticQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
{
///
/// The numeric value this quantity was constructed with.
@@ -133,8 +133,11 @@ public AreaMomentOfInertia(double value, UnitSystem unitSystem)
///
public static AreaMomentOfInertia Zero { get; }
- #endregion
+ ///
+ public static AreaMomentOfInertia AdditiveIdentity => Zero;
+ #endregion
+
#region Properties
///
diff --git a/UnitsNet/GeneratedCode/Quantities/BitRate.g.cs b/UnitsNet/GeneratedCode/Quantities/BitRate.g.cs
index 2d0c7e693f..7d9029adba 100644
--- a/UnitsNet/GeneratedCode/Quantities/BitRate.g.cs
+++ b/UnitsNet/GeneratedCode/Quantities/BitRate.g.cs
@@ -39,7 +39,7 @@ namespace UnitsNet
/// https://en.wikipedia.org/wiki/Bit_rate
///
[DataContract]
- public readonly partial struct BitRate : IQuantity, IDecimalQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
+ public readonly partial struct BitRate : IArithmeticQuantity, IDecimalQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
{
///
/// The numeric value this quantity was constructed with.
@@ -156,8 +156,11 @@ public BitRate(decimal value, UnitSystem unitSystem)
///
public static BitRate Zero { get; }
- #endregion
+ ///
+ public static BitRate AdditiveIdentity => Zero;
+ #endregion
+
#region Properties
///
diff --git a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs
index c3e720e792..2f349e2ecb 100644
--- a/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs
+++ b/UnitsNet/GeneratedCode/Quantities/BrakeSpecificFuelConsumption.g.cs
@@ -36,7 +36,7 @@ namespace UnitsNet
/// Brake specific fuel consumption (BSFC) is a measure of the fuel efficiency of any prime mover that burns fuel and produces rotational, or shaft, power. It is typically used for comparing the efficiency of internal combustion engines with a shaft output.
///
[DataContract]
- public readonly partial struct BrakeSpecificFuelConsumption : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
+ public readonly partial struct BrakeSpecificFuelConsumption : IArithmeticQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
{
///
/// The numeric value this quantity was constructed with.
@@ -130,8 +130,11 @@ public BrakeSpecificFuelConsumption(double value, UnitSystem unitSystem)
///
public static BrakeSpecificFuelConsumption Zero { get; }
- #endregion
+ ///
+ public static BrakeSpecificFuelConsumption AdditiveIdentity => Zero;
+ #endregion
+
#region Properties
///
diff --git a/UnitsNet/GeneratedCode/Quantities/Capacitance.g.cs b/UnitsNet/GeneratedCode/Quantities/Capacitance.g.cs
index 66108a7d99..cccf254368 100644
--- a/UnitsNet/GeneratedCode/Quantities/Capacitance.g.cs
+++ b/UnitsNet/GeneratedCode/Quantities/Capacitance.g.cs
@@ -39,7 +39,7 @@ namespace UnitsNet
/// https://en.wikipedia.org/wiki/Capacitance
///
[DataContract]
- public readonly partial struct Capacitance : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
+ public readonly partial struct Capacitance : IArithmeticQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
{
///
/// The numeric value this quantity was constructed with.
@@ -137,8 +137,11 @@ public Capacitance(double value, UnitSystem unitSystem)
///
public static Capacitance Zero { get; }
- #endregion
+ ///
+ public static Capacitance AdditiveIdentity => Zero;
+ #endregion
+
#region Properties
///
diff --git a/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.g.cs b/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.g.cs
index 3dde7f804d..3e75018447 100644
--- a/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.g.cs
+++ b/UnitsNet/GeneratedCode/Quantities/CoefficientOfThermalExpansion.g.cs
@@ -36,7 +36,7 @@ namespace UnitsNet
/// A unit that represents a fractional change in size in response to a change in temperature.
///
[DataContract]
- public readonly partial struct CoefficientOfThermalExpansion : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
+ public readonly partial struct CoefficientOfThermalExpansion : IArithmeticQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
{
///
/// The numeric value this quantity was constructed with.
@@ -130,8 +130,11 @@ public CoefficientOfThermalExpansion(double value, UnitSystem unitSystem)
///
public static CoefficientOfThermalExpansion Zero { get; }
- #endregion
+ ///
+ public static CoefficientOfThermalExpansion AdditiveIdentity => Zero;
+ #endregion
+
#region Properties
///
diff --git a/UnitsNet/GeneratedCode/Quantities/Compressibility.g.cs b/UnitsNet/GeneratedCode/Quantities/Compressibility.g.cs
index 4afa6d3cde..e965366524 100644
--- a/UnitsNet/GeneratedCode/Quantities/Compressibility.g.cs
+++ b/UnitsNet/GeneratedCode/Quantities/Compressibility.g.cs
@@ -36,7 +36,7 @@ namespace UnitsNet
///
///
[DataContract]
- public readonly partial struct Compressibility : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
+ public readonly partial struct Compressibility : IArithmeticQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
{
///
/// The numeric value this quantity was constructed with.
@@ -134,8 +134,11 @@ public Compressibility(double value, UnitSystem unitSystem)
///
public static Compressibility Zero { get; }
- #endregion
+ ///
+ public static Compressibility AdditiveIdentity => Zero;
+ #endregion
+
#region Properties
///
diff --git a/UnitsNet/GeneratedCode/Quantities/Density.g.cs b/UnitsNet/GeneratedCode/Quantities/Density.g.cs
index 562b9d5bb8..6196ea3180 100644
--- a/UnitsNet/GeneratedCode/Quantities/Density.g.cs
+++ b/UnitsNet/GeneratedCode/Quantities/Density.g.cs
@@ -39,7 +39,7 @@ namespace UnitsNet
/// http://en.wikipedia.org/wiki/Density
///
[DataContract]
- public readonly partial struct Density : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
+ public readonly partial struct Density : IArithmeticQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
{
///
/// The numeric value this quantity was constructed with.
@@ -181,8 +181,11 @@ public Density(double value, UnitSystem unitSystem)
///
public static Density Zero { get; }
- #endregion
+ ///
+ public static Density AdditiveIdentity => Zero;
+ #endregion
+
#region Properties
///
diff --git a/UnitsNet/GeneratedCode/Quantities/Duration.g.cs b/UnitsNet/GeneratedCode/Quantities/Duration.g.cs
index 0d91258e7b..36ef64fed4 100644
--- a/UnitsNet/GeneratedCode/Quantities/Duration.g.cs
+++ b/UnitsNet/GeneratedCode/Quantities/Duration.g.cs
@@ -36,7 +36,7 @@ namespace UnitsNet
/// Time is a dimension in which events can be ordered from the past through the present into the future, and also the measure of durations of events and the intervals between them.
///
[DataContract]
- public readonly partial struct Duration : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
+ public readonly partial struct Duration : IArithmeticQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
{
///
/// The numeric value this quantity was constructed with.
@@ -138,8 +138,11 @@ public Duration(double value, UnitSystem unitSystem)
///
public static Duration Zero { get; }
- #endregion
+ ///
+ public static Duration AdditiveIdentity => Zero;
+ #endregion
+
#region Properties
///
diff --git a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs
index 2150ca69d0..7341186c46 100644
--- a/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs
+++ b/UnitsNet/GeneratedCode/Quantities/DynamicViscosity.g.cs
@@ -39,7 +39,7 @@ namespace UnitsNet
/// https://en.wikipedia.org/wiki/Viscosity#Dynamic_.28shear.29_viscosity
///
[DataContract]
- public readonly partial struct DynamicViscosity : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
+ public readonly partial struct DynamicViscosity : IArithmeticQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
{
///
/// The numeric value this quantity was constructed with.
@@ -140,8 +140,11 @@ public DynamicViscosity(double value, UnitSystem unitSystem)
///
public static DynamicViscosity Zero { get; }
- #endregion
+ ///
+ public static DynamicViscosity AdditiveIdentity => Zero;
+ #endregion
+
#region Properties
///
diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs
index 2d1dcc221c..4c37320694 100644
--- a/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs
+++ b/UnitsNet/GeneratedCode/Quantities/ElectricAdmittance.g.cs
@@ -36,7 +36,7 @@ namespace UnitsNet
/// Electric admittance is a measure of how easily a circuit or device will allow a current to flow. It is defined as the inverse of impedance. The SI unit of admittance is the siemens (symbol S).
///
[DataContract]
- public readonly partial struct ElectricAdmittance : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
+ public readonly partial struct ElectricAdmittance : IArithmeticQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
{
///
/// The numeric value this quantity was constructed with.
@@ -131,8 +131,11 @@ public ElectricAdmittance(double value, UnitSystem unitSystem)
///
public static ElectricAdmittance Zero { get; }
- #endregion
+ ///
+ public static ElectricAdmittance AdditiveIdentity => Zero;
+ #endregion
+
#region Properties
///
diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs
index 36b9a67a9a..22a34c7766 100644
--- a/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs
+++ b/UnitsNet/GeneratedCode/Quantities/ElectricCharge.g.cs
@@ -39,7 +39,7 @@ namespace UnitsNet
/// https://en.wikipedia.org/wiki/Electric_charge
///
[DataContract]
- public readonly partial struct ElectricCharge : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
+ public readonly partial struct ElectricCharge : IArithmeticQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
{
///
/// The numeric value this quantity was constructed with.
@@ -135,8 +135,11 @@ public ElectricCharge(double value, UnitSystem unitSystem)
///
public static ElectricCharge Zero { get; }
- #endregion
+ ///
+ public static ElectricCharge AdditiveIdentity => Zero;
+ #endregion
+
#region Properties
///
diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs
index 30ac513bca..8c93da965a 100644
--- a/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs
+++ b/UnitsNet/GeneratedCode/Quantities/ElectricChargeDensity.g.cs
@@ -39,7 +39,7 @@ namespace UnitsNet
/// https://en.wikipedia.org/wiki/Charge_density
///
[DataContract]
- public readonly partial struct ElectricChargeDensity : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
+ public readonly partial struct ElectricChargeDensity : IArithmeticQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
{
///
/// The numeric value this quantity was constructed with.
@@ -131,8 +131,11 @@ public ElectricChargeDensity(double value, UnitSystem unitSystem)
///
public static ElectricChargeDensity Zero { get; }
- #endregion
+ ///
+ public static ElectricChargeDensity AdditiveIdentity => Zero;
+ #endregion
+
#region Properties
///
diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs
index b33d4813c0..8e1c71f938 100644
--- a/UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs
+++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductance.g.cs
@@ -39,7 +39,7 @@ namespace UnitsNet
/// https://en.wikipedia.org/wiki/Electrical_resistance_and_conductance
///
[DataContract]
- public readonly partial struct ElectricConductance : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
+ public readonly partial struct ElectricConductance : IArithmeticQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
{
///
/// The numeric value this quantity was constructed with.
@@ -133,8 +133,11 @@ public ElectricConductance(double value, UnitSystem unitSystem)
///
public static ElectricConductance Zero { get; }
- #endregion
+ ///
+ public static ElectricConductance AdditiveIdentity => Zero;
+ #endregion
+
#region Properties
///
diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs
index 5718108366..5dee91d567 100644
--- a/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs
+++ b/UnitsNet/GeneratedCode/Quantities/ElectricConductivity.g.cs
@@ -39,7 +39,7 @@ namespace UnitsNet
/// https://en.wikipedia.org/wiki/Electrical_resistivity_and_conductivity
///
[DataContract]
- public readonly partial struct ElectricConductivity : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
+ public readonly partial struct ElectricConductivity : IArithmeticQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
{
///
/// The numeric value this quantity was constructed with.
@@ -136,8 +136,11 @@ public ElectricConductivity(double value, UnitSystem unitSystem)
///
public static ElectricConductivity Zero { get; }
- #endregion
+ ///
+ public static ElectricConductivity AdditiveIdentity => Zero;
+ #endregion
+
#region Properties
///
diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs
index df17e0900f..7dc5fbfa3b 100644
--- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs
+++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrent.g.cs
@@ -36,7 +36,7 @@ namespace UnitsNet
/// An electric current is a flow of electric charge. In electric circuits this charge is often carried by moving electrons in a wire. It can also be carried by ions in an electrolyte, or by both ions and electrons such as in a plasma.
///
[DataContract]
- public readonly partial struct ElectricCurrent : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
+ public readonly partial struct ElectricCurrent : IArithmeticQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
{
///
/// The numeric value this quantity was constructed with.
@@ -135,8 +135,11 @@ public ElectricCurrent(double value, UnitSystem unitSystem)
///
public static ElectricCurrent Zero { get; }
- #endregion
+ ///
+ public static ElectricCurrent AdditiveIdentity => Zero;
+ #endregion
+
#region Properties
///
diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs
index 6d3bb4593a..2a0d07c524 100644
--- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs
+++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentDensity.g.cs
@@ -39,7 +39,7 @@ namespace UnitsNet
/// https://en.wikipedia.org/wiki/Current_density
///
[DataContract]
- public readonly partial struct ElectricCurrentDensity : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
+ public readonly partial struct ElectricCurrentDensity : IArithmeticQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
{
///
/// The numeric value this quantity was constructed with.
@@ -133,8 +133,11 @@ public ElectricCurrentDensity(double value, UnitSystem unitSystem)
///
public static ElectricCurrentDensity Zero { get; }
- #endregion
+ ///
+ public static ElectricCurrentDensity AdditiveIdentity => Zero;
+ #endregion
+
#region Properties
///
diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs
index 577732eb7d..40d2ce444b 100644
--- a/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs
+++ b/UnitsNet/GeneratedCode/Quantities/ElectricCurrentGradient.g.cs
@@ -36,7 +36,7 @@ namespace UnitsNet
/// In electromagnetism, the current gradient describes how the current changes in time.
///
[DataContract]
- public readonly partial struct ElectricCurrentGradient : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
+ public readonly partial struct ElectricCurrentGradient : IArithmeticQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
{
///
/// The numeric value this quantity was constructed with.
@@ -131,8 +131,11 @@ public ElectricCurrentGradient(double value, UnitSystem unitSystem)
///
public static ElectricCurrentGradient Zero { get; }
- #endregion
+ ///
+ public static ElectricCurrentGradient AdditiveIdentity => Zero;
+ #endregion
+
#region Properties
///
diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs
index 6e17384f3f..7809de6fe8 100644
--- a/UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs
+++ b/UnitsNet/GeneratedCode/Quantities/ElectricField.g.cs
@@ -39,7 +39,7 @@ namespace UnitsNet
/// https://en.wikipedia.org/wiki/Electric_field
///
[DataContract]
- public readonly partial struct ElectricField : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
+ public readonly partial struct ElectricField : IArithmeticQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
{
///
/// The numeric value this quantity was constructed with.
@@ -131,8 +131,11 @@ public ElectricField(double value, UnitSystem unitSystem)
///
public static ElectricField Zero { get; }
- #endregion
+ ///
+ public static ElectricField AdditiveIdentity => Zero;
+ #endregion
+
#region Properties
///
diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs
index 39c37813fb..5ed2447816 100644
--- a/UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs
+++ b/UnitsNet/GeneratedCode/Quantities/ElectricInductance.g.cs
@@ -39,7 +39,7 @@ namespace UnitsNet
/// https://en.wikipedia.org/wiki/Inductance
///
[DataContract]
- public readonly partial struct ElectricInductance : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
+ public readonly partial struct ElectricInductance : IArithmeticQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
{
///
/// The numeric value this quantity was constructed with.
@@ -134,8 +134,11 @@ public ElectricInductance(double value, UnitSystem unitSystem)
///
public static ElectricInductance Zero { get; }
- #endregion
+ ///
+ public static ElectricInductance AdditiveIdentity => Zero;
+ #endregion
+
#region Properties
///
diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs
index 840b5cb912..041b123462 100644
--- a/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs
+++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotential.g.cs
@@ -36,7 +36,7 @@ namespace UnitsNet
/// In classical electromagnetism, the electric potential (a scalar quantity denoted by Φ, ΦE or V and also called the electric field potential or the electrostatic potential) at a point is the amount of electric potential energy that a unitary point charge would have when located at that point.
///
[DataContract]
- public readonly partial struct ElectricPotential : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
+ public readonly partial struct ElectricPotential : IArithmeticQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
{
///
/// The numeric value this quantity was constructed with.
@@ -132,8 +132,11 @@ public ElectricPotential(double value, UnitSystem unitSystem)
///
public static ElectricPotential Zero { get; }
- #endregion
+ ///
+ public static ElectricPotential AdditiveIdentity => Zero;
+ #endregion
+
#region Properties
///
diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.g.cs
index f1151d4544..2f4e5a6dcc 100644
--- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.g.cs
+++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialAc.g.cs
@@ -36,7 +36,7 @@ namespace UnitsNet
/// The Electric Potential of a system known to use Alternating Current.
///
[DataContract]
- public readonly partial struct ElectricPotentialAc : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
+ public readonly partial struct ElectricPotentialAc : IArithmeticQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
{
///
/// The numeric value this quantity was constructed with.
@@ -132,8 +132,11 @@ public ElectricPotentialAc(double value, UnitSystem unitSystem)
///
public static ElectricPotentialAc Zero { get; }
- #endregion
+ ///
+ public static ElectricPotentialAc AdditiveIdentity => Zero;
+ #endregion
+
#region Properties
///
diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialChangeRate.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialChangeRate.g.cs
index 12bd47e2a8..4f3a640775 100644
--- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialChangeRate.g.cs
+++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialChangeRate.g.cs
@@ -36,7 +36,7 @@ namespace UnitsNet
/// ElectricPotential change rate is the ratio of the electric potential change to the time during which the change occurred (value of electric potential changes per unit time).
///
[DataContract]
- public readonly partial struct ElectricPotentialChangeRate : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
+ public readonly partial struct ElectricPotentialChangeRate : IArithmeticQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
{
///
/// The numeric value this quantity was constructed with.
@@ -147,8 +147,11 @@ public ElectricPotentialChangeRate(double value, UnitSystem unitSystem)
///
public static ElectricPotentialChangeRate Zero { get; }
- #endregion
+ ///
+ public static ElectricPotentialChangeRate AdditiveIdentity => Zero;
+ #endregion
+
#region Properties
///
diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.g.cs
index 7ce7898c1b..a2bd0b9f52 100644
--- a/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.g.cs
+++ b/UnitsNet/GeneratedCode/Quantities/ElectricPotentialDc.g.cs
@@ -36,7 +36,7 @@ namespace UnitsNet
/// The Electric Potential of a system known to use Direct Current.
///
[DataContract]
- public readonly partial struct ElectricPotentialDc : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
+ public readonly partial struct ElectricPotentialDc : IArithmeticQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
{
///
/// The numeric value this quantity was constructed with.
@@ -132,8 +132,11 @@ public ElectricPotentialDc(double value, UnitSystem unitSystem)
///
public static ElectricPotentialDc Zero { get; }
- #endregion
+ ///
+ public static ElectricPotentialDc AdditiveIdentity => Zero;
+ #endregion
+
#region Properties
///
diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs
index 2e69b277b8..0895f8712c 100644
--- a/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs
+++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistance.g.cs
@@ -36,7 +36,7 @@ namespace UnitsNet
/// The electrical resistance of an electrical conductor is the opposition to the passage of an electric current through that conductor.
///
[DataContract]
- public readonly partial struct ElectricResistance : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
+ public readonly partial struct ElectricResistance : IArithmeticQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
{
///
/// The numeric value this quantity was constructed with.
@@ -133,8 +133,11 @@ public ElectricResistance(double value, UnitSystem unitSystem)
///
public static ElectricResistance Zero { get; }
- #endregion
+ ///
+ public static ElectricResistance AdditiveIdentity => Zero;
+ #endregion
+
#region Properties
///
diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs
index 66e4dc877c..28116b891b 100644
--- a/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs
+++ b/UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs
@@ -39,7 +39,7 @@ namespace UnitsNet
/// https://en.wikipedia.org/wiki/Electrical_resistivity_and_conductivity
///
[DataContract]
- public readonly partial struct ElectricResistivity : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
+ public readonly partial struct ElectricResistivity : IArithmeticQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
{
///
/// The numeric value this quantity was constructed with.
@@ -144,8 +144,11 @@ public ElectricResistivity(double value, UnitSystem unitSystem)
///
public static ElectricResistivity Zero { get; }
- #endregion
+ ///
+ public static ElectricResistivity AdditiveIdentity => Zero;
+ #endregion
+
#region Properties
///
diff --git a/UnitsNet/GeneratedCode/Quantities/ElectricSurfaceChargeDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/ElectricSurfaceChargeDensity.g.cs
index f4fc4e817d..1400483cea 100644
--- a/UnitsNet/GeneratedCode/Quantities/ElectricSurfaceChargeDensity.g.cs
+++ b/UnitsNet/GeneratedCode/Quantities/ElectricSurfaceChargeDensity.g.cs
@@ -39,7 +39,7 @@ namespace UnitsNet
/// https://en.wikipedia.org/wiki/Charge_density
///
[DataContract]
- public readonly partial struct ElectricSurfaceChargeDensity : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
+ public readonly partial struct ElectricSurfaceChargeDensity : IArithmeticQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
{
///
/// The numeric value this quantity was constructed with.
@@ -133,8 +133,11 @@ public ElectricSurfaceChargeDensity(double value, UnitSystem unitSystem)
///
public static ElectricSurfaceChargeDensity Zero { get; }
- #endregion
+ ///
+ public static ElectricSurfaceChargeDensity AdditiveIdentity => Zero;
+ #endregion
+
#region Properties
///
diff --git a/UnitsNet/GeneratedCode/Quantities/Energy.g.cs b/UnitsNet/GeneratedCode/Quantities/Energy.g.cs
index f494a8a7f1..12bc85d96d 100644
--- a/UnitsNet/GeneratedCode/Quantities/Energy.g.cs
+++ b/UnitsNet/GeneratedCode/Quantities/Energy.g.cs
@@ -36,7 +36,7 @@ namespace UnitsNet
/// The joule, symbol J, is a derived unit of energy, work, or amount of heat in the International System of Units. It is equal to the energy transferred (or work done) when applying a force of one newton through a distance of one metre (1 newton metre or N·m), or in passing an electric current of one ampere through a resistance of one ohm for one second. Many other units of energy are included. Please do not confuse this definition of the calorie with the one colloquially used by the food industry, the large calorie, which is equivalent to 1 kcal. Thermochemical definition of the calorie is used. For BTU, the IT definition is used.
///
[DataContract]
- public readonly partial struct Energy : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
+ public readonly partial struct Energy : IArithmeticQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
{
///
/// The numeric value this quantity was constructed with.
@@ -165,8 +165,11 @@ public Energy(double value, UnitSystem unitSystem)
///
public static Energy Zero { get; }
- #endregion
+ ///
+ public static Energy AdditiveIdentity => Zero;
+ #endregion
+
#region Properties
///
diff --git a/UnitsNet/GeneratedCode/Quantities/EnergyDensity.g.cs b/UnitsNet/GeneratedCode/Quantities/EnergyDensity.g.cs
index 8146a11acf..d6fddeeb95 100644
--- a/UnitsNet/GeneratedCode/Quantities/EnergyDensity.g.cs
+++ b/UnitsNet/GeneratedCode/Quantities/EnergyDensity.g.cs
@@ -36,7 +36,7 @@ namespace UnitsNet
///
///
[DataContract]
- public readonly partial struct EnergyDensity : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
+ public readonly partial struct EnergyDensity : IArithmeticQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
{
///
/// The numeric value this quantity was constructed with.
@@ -139,8 +139,11 @@ public EnergyDensity(double value, UnitSystem unitSystem)
///
public static EnergyDensity Zero { get; }
- #endregion
+ ///
+ public static EnergyDensity AdditiveIdentity => Zero;
+ #endregion
+
#region Properties
///
diff --git a/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs b/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs
index 2c3f7a80bd..4d0a45b92b 100644
--- a/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs
+++ b/UnitsNet/GeneratedCode/Quantities/Entropy.g.cs
@@ -36,7 +36,7 @@ namespace UnitsNet
/// Entropy is an important concept in the branch of science known as thermodynamics. The idea of "irreversibility" is central to the understanding of entropy. It is often said that entropy is an expression of the disorder, or randomness of a system, or of our lack of information about it. Entropy is an extensive property. It has the dimension of energy divided by temperature, which has a unit of joules per kelvin (J/K) in the International System of Units
///
[DataContract]
- public readonly partial struct Entropy : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
+ public readonly partial struct Entropy : IArithmeticQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
{
///
/// The numeric value this quantity was constructed with.
@@ -134,8 +134,11 @@ public Entropy(double value, UnitSystem unitSystem)
///
public static Entropy Zero { get; }
- #endregion
+ ///
+ public static Entropy AdditiveIdentity => Zero;
+ #endregion
+
#region Properties
///
diff --git a/UnitsNet/GeneratedCode/Quantities/Force.g.cs b/UnitsNet/GeneratedCode/Quantities/Force.g.cs
index 4e088bff93..b5d6412ea5 100644
--- a/UnitsNet/GeneratedCode/Quantities/Force.g.cs
+++ b/UnitsNet/GeneratedCode/Quantities/Force.g.cs
@@ -36,7 +36,7 @@ namespace UnitsNet
/// In physics, a force is any influence that causes an object to undergo a certain change, either concerning its movement, direction, or geometrical construction. In other words, a force can cause an object with mass to change its velocity (which includes to begin moving from a state of rest), i.e., to accelerate, or a flexible object to deform, or both. Force can also be described by intuitive concepts such as a push or a pull. A force has both magnitude and direction, making it a vector quantity. It is measured in the SI unit of newtons and represented by the symbol F.
///
[DataContract]
- public readonly partial struct Force : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
+ public readonly partial struct Force : IArithmeticQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
{
///
/// The numeric value this quantity was constructed with.
@@ -142,8 +142,11 @@ public Force(double value, UnitSystem unitSystem)
///
public static Force Zero { get; }
- #endregion
+ ///
+ public static Force AdditiveIdentity => Zero;
+ #endregion
+
#region Properties
///
diff --git a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs
index 716fc21aff..ad41cfec24 100644
--- a/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs
+++ b/UnitsNet/GeneratedCode/Quantities/ForceChangeRate.g.cs
@@ -36,7 +36,7 @@ namespace UnitsNet
/// Force change rate is the ratio of the force change to the time during which the change occurred (value of force changes per unit time).
///
[DataContract]
- public readonly partial struct ForceChangeRate : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
+ public readonly partial struct ForceChangeRate : IArithmeticQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
{
///
/// The numeric value this quantity was constructed with.
@@ -142,8 +142,11 @@ public ForceChangeRate(double value, UnitSystem unitSystem)
///
public static ForceChangeRate Zero { get; }
- #endregion
+ ///
+ public static ForceChangeRate AdditiveIdentity => Zero;
+ #endregion
+
#region Properties
///
diff --git a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs
index 4f192b5051..c128f3a3a2 100644
--- a/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs
+++ b/UnitsNet/GeneratedCode/Quantities/ForcePerLength.g.cs
@@ -36,7 +36,7 @@ namespace UnitsNet
/// The magnitude of force per unit length.
///
[DataContract]
- public readonly partial struct ForcePerLength : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
+ public readonly partial struct ForcePerLength : IArithmeticQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
{
///
/// The numeric value this quantity was constructed with.
@@ -165,8 +165,11 @@ public ForcePerLength(double value, UnitSystem unitSystem)
///
public static ForcePerLength Zero { get; }
- #endregion
+ ///
+ public static ForcePerLength AdditiveIdentity => Zero;
+ #endregion
+
#region Properties
///
diff --git a/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs b/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs
index a61381fd26..54cd92d566 100644
--- a/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs
+++ b/UnitsNet/GeneratedCode/Quantities/Frequency.g.cs
@@ -36,7 +36,7 @@ namespace UnitsNet
/// The number of occurrences of a repeating event per unit time.
///
[DataContract]
- public readonly partial struct Frequency : IQuantity, IEquatable, IComparable, IComparable, IConvertible, IFormattable
+ public readonly partial struct Frequency : IArithmeticQuantity, IEquatable