float getIncrement(float pos) { switch ((int)pos) { // Cast to int for range comparison case 0 ... 9: return 0.1; case 10 ... 19: return 0.5; default: return 1.0; }}