Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit f932d444 authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

make check for IsBetween tolerante against mixing min/max values

parent 590536ec
No related branches found
No related tags found
No related merge requests found
......@@ -174,7 +174,7 @@ namespace TUGraz.VectoCommon.Utils
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool IsBetween(this double self, double min, double max)
{
return min <= self && self <= max;
return Math.Min(min, max) <= self && self <= Math.Max(min, max);
}
/// <summary>
......@@ -184,7 +184,7 @@ namespace TUGraz.VectoCommon.Utils
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool IsBetween(this double self, SI min, SI max)
{
return min <= self && self <= max;
return VectoMath.Min(min, max) <= self && self <= VectoMath.Max(min, max);
}
/// <summary>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment