Skip to content

Commit

Permalink
Use IsNumericType
Browse files Browse the repository at this point in the history
  • Loading branch information
manfred-brands committed Dec 18, 2024
1 parent c999e34 commit 36b8b1d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public ConstraintResult ApplyTo(T actual)
// In that case fall back to the default equality comparison.
bool hasSucceeded;

if (Numerics.IsNumericType(actual))
if (Numerics.IsNumericType(typeof(T)))
{
hasSucceeded = Numerics.AreEqual(_expected, actual, ref _tolerance);
}
Expand Down Expand Up @@ -155,7 +155,7 @@ public override ConstraintResult ApplyTo<TActual>(TActual actual)
{
hasSucceeded = false;
}
else if (actual is T t && Numerics.IsNumericType(t))
else if (actual is T t && Numerics.IsNumericType(typeof(T)))
{
hasSucceeded = Numerics.AreEqual(_expected, t, ref _tolerance);
}
Expand Down

0 comments on commit 36b8b1d

Please sign in to comment.