diff --git a/simgear/math/SGMisc.hxx b/simgear/math/SGMisc.hxx index a154d632..89417cb3 100644 --- a/simgear/math/SGMisc.hxx +++ b/simgear/math/SGMisc.hxx @@ -65,7 +65,7 @@ public: return min; T normalized = value - range*floor((value - min)/range); // two security checks that can only happen due to roundoff - if (value <= min) + if (normalized <= min) return min; if (max <= normalized) return min;