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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CodeGen/Generators/UnitsNetGen/QuantityGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ private void GenerateRelationalOperators()
/// <returns>The corresponding inverse quantity, <see cref=""{relation.RightQuantity.Name}""/>.</returns>
public {relation.RightQuantity.Name} Inverse()
{{
return {relation.LeftUnit.PluralName} == 0.0 ? {relation.RightQuantity.Name}.Zero : {relation.RightQuantity.Name}.From{relation.RightUnit.PluralName}(1 / {relation.LeftUnit.PluralName});
return {relation.RightQuantity.Name}.From{relation.RightUnit.PluralName}(1 / {relation.LeftUnit.PluralName});
}}
");
}
Expand Down
2 changes: 1 addition & 1 deletion UnitsNet.Tests/CustomCode/AreaTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public void ToUnit_GivenSIUnitSystem_ReturnsSIQuantity()
[Theory]
[InlineData(-2.0, -0.5)]
[InlineData(-1.0, -1.0)]
[InlineData(0.0, 0.0)]
[InlineData(0.0, double.PositiveInfinity)]
[InlineData(1.0, 1.0)]
[InlineData(2.0, 0.5)]
public void InverseReturnsReciprocalArea(double value, double expected)
Expand Down
2 changes: 1 addition & 1 deletion UnitsNet.Tests/CustomCode/ElectricConductivityTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class ElectricConductivityTests : ElectricConductivityTestsBase
[Theory]
[InlineData( -1.0, -1.0 )]
[InlineData( -2.0, -0.5 )]
[InlineData( 0.0, 0.0 )]
[InlineData( 0.0, double.PositiveInfinity )]
[InlineData( 1.0, 1.0 )]
[InlineData( 2.0, 0.5 )]
public static void InverseTest( double value, double expected )
Expand Down
2 changes: 1 addition & 1 deletion UnitsNet.Tests/CustomCode/ElectricResistivityTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public class ElectricResistivityTests : ElectricResistivityTestsBase
[Theory]
[InlineData( -1.0, -1.0 )]
[InlineData( -2.0, -0.5 )]
[InlineData( 0.0, 0.0 )]
[InlineData( 0.0, double.PositiveInfinity )]
[InlineData( 1.0, 1.0 )]
[InlineData( 2.0, 0.5 )]
public static void InverseTest( double value, double expected )
Expand Down
2 changes: 1 addition & 1 deletion UnitsNet.Tests/CustomCode/LengthTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ public void ToUnit_GivenSIUnitSystem_ReturnsSIQuantity()
[Theory]
[InlineData(-1.0, -1.0)]
[InlineData(-2.0, -0.5)]
[InlineData(0.0, 0.0)]
[InlineData(0.0, double.PositiveInfinity)]
[InlineData(1.0, 1.0)]
[InlineData(2.0, 0.5)]
public static void InverseReturnsReciprocalLength(double value, double expected)
Expand Down
2 changes: 1 addition & 1 deletion UnitsNet.Tests/CustomCode/ReciprocalAreaTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class ReciprocalAreaTests : ReciprocalAreaTestsBase
[Theory]
[InlineData(-2.0, -0.5)]
[InlineData(-1.0, -1.0)]
[InlineData(0.0, 0.0)]
[InlineData(0.0, double.PositiveInfinity)]
[InlineData(1.0, 1.0)]
[InlineData(2.0, 0.5)]
public void InverseReturnsArea(double value, double expected)
Expand Down
2 changes: 1 addition & 1 deletion UnitsNet.Tests/CustomCode/ReciprocalLengthTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class ReciprocalLengthTests : ReciprocalLengthTestsBase
[Theory]
[InlineData(-1.0, -1.0)]
[InlineData(-2.0, -0.5)]
[InlineData(0.0, 0.0)]
[InlineData(0.0, double.PositiveInfinity)]
[InlineData(1.0, 1.0)]
[InlineData(2.0, 0.5)]
public static void InverseReturnsLength(double value, double expected)
Expand Down
2 changes: 1 addition & 1 deletion UnitsNet/GeneratedCode/Quantities/Area.g.cs

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

2 changes: 1 addition & 1 deletion UnitsNet/GeneratedCode/Quantities/Density.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.

2 changes: 1 addition & 1 deletion UnitsNet/GeneratedCode/Quantities/ElectricResistivity.g.cs

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

2 changes: 1 addition & 1 deletion UnitsNet/GeneratedCode/Quantities/Length.g.cs

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

2 changes: 1 addition & 1 deletion UnitsNet/GeneratedCode/Quantities/ReciprocalArea.g.cs

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

2 changes: 1 addition & 1 deletion UnitsNet/GeneratedCode/Quantities/ReciprocalLength.g.cs

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

2 changes: 1 addition & 1 deletion UnitsNet/GeneratedCode/Quantities/SpecificVolume.g.cs

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