Thats easy, this is just a confusion of float and var.
With minv you compare two vars, but with the ">22.6" you compare two floats because "22.6" is a float constant in C. The var 22.6 is always slightly less than the float 22.6 because some decimals are cut off. That's why your comparison is always true. Only when you put a (var) before the 22.6, then you have really a var and your comparison probably works, although I would still not trust such a code.
Hope this helps. This is probably not easy to see for a beginner but you can avoid such bugs when you never assume in a comparison that different generated floats have exactly the same value. Thats one of the first things to learn in C courses.