A switch type function

It is not necessary to check the left interval border.

n = 1.1
m = n ≤ 0.1   ? 0.0 :
    n ≤ 0.6   ? 1.0 :
    n ≤ 0.8   ? 1.1 :
    n ≤ 1.0   ? 1.2 :
    n ≤ 1.3   ? 1.35 :
    #= otherwise =# 2.2
6 Likes