@@ -52,7 +52,7 @@ public static class Comparison
52
52
public static bool Equals ( double referenceValue , double otherValue , double tolerance , ComparisonType comparisonType )
53
53
{
54
54
if ( tolerance < 0 )
55
- throw new ArgumentOutOfRangeException ( " tolerance" , "Tolerance must be greater than or equal to 0" ) ;
55
+ throw new ArgumentOutOfRangeException ( nameof ( tolerance ) , "Tolerance must be greater than or equal to 0" ) ;
56
56
57
57
switch ( comparisonType )
58
58
{
@@ -107,7 +107,7 @@ public static bool Equals(double referenceValue, double otherValue, double toler
107
107
public static bool Equals ( decimal referenceValue , decimal otherValue , decimal tolerance , ComparisonType comparisonType )
108
108
{
109
109
if ( tolerance < 0 )
110
- throw new ArgumentOutOfRangeException ( " tolerance" , "Tolerance must be greater than or equal to 0" ) ;
110
+ throw new ArgumentOutOfRangeException ( nameof ( tolerance ) , "Tolerance must be greater than or equal to 0" ) ;
111
111
112
112
switch ( comparisonType )
113
113
{
@@ -144,7 +144,7 @@ public static bool Equals(decimal referenceValue, decimal otherValue, decimal to
144
144
public static bool EqualsRelative ( double referenceValue , double otherValue , double tolerance )
145
145
{
146
146
if ( tolerance < 0 )
147
- throw new ArgumentOutOfRangeException ( " tolerance" , "Tolerance must be greater than or equal to 0" ) ;
147
+ throw new ArgumentOutOfRangeException ( nameof ( tolerance ) , "Tolerance must be greater than or equal to 0" ) ;
148
148
149
149
var maxVariation = Math . Abs ( referenceValue * tolerance ) ;
150
150
return Math . Abs ( referenceValue - otherValue ) <= maxVariation ;
@@ -174,7 +174,7 @@ public static bool EqualsRelative(double referenceValue, double otherValue, doub
174
174
public static bool EqualsRelative ( decimal referenceValue , decimal otherValue , decimal tolerance )
175
175
{
176
176
if ( tolerance < 0 )
177
- throw new ArgumentOutOfRangeException ( " tolerance" , "Tolerance must be greater than or equal to 0" ) ;
177
+ throw new ArgumentOutOfRangeException ( nameof ( tolerance ) , "Tolerance must be greater than or equal to 0" ) ;
178
178
179
179
var maxVariation = Math . Abs ( referenceValue * tolerance ) ;
180
180
return Math . Abs ( referenceValue - otherValue ) <= maxVariation ;
@@ -202,7 +202,7 @@ public static bool EqualsRelative(decimal referenceValue, decimal otherValue, de
202
202
public static bool EqualsAbsolute ( double value1 , double value2 , double tolerance )
203
203
{
204
204
if ( tolerance < 0 )
205
- throw new ArgumentOutOfRangeException ( " tolerance" , "Tolerance must be greater than or equal to 0" ) ;
205
+ throw new ArgumentOutOfRangeException ( nameof ( tolerance ) , "Tolerance must be greater than or equal to 0" ) ;
206
206
207
207
return Math . Abs ( value1 - value2 ) <= tolerance ;
208
208
}
@@ -229,7 +229,7 @@ public static bool EqualsAbsolute(double value1, double value2, double tolerance
229
229
public static bool EqualsAbsolute ( decimal value1 , decimal value2 , decimal tolerance )
230
230
{
231
231
if ( tolerance < 0 )
232
- throw new ArgumentOutOfRangeException ( " tolerance" , "Tolerance must be greater than or equal to 0" ) ;
232
+ throw new ArgumentOutOfRangeException ( nameof ( tolerance ) , "Tolerance must be greater than or equal to 0" ) ;
233
233
234
234
return Math . Abs ( value1 - value2 ) <= tolerance ;
235
235
}
0 commit comments