(int amount, int low, int high)
| 55 | |
| 56 | // with modulation fall in range [low, high] |
| 57 | public static int wrap(int amount, int low, int high) |
| 58 | { |
| 59 | if(BuildConfig.DEBUG && low >= high) |
| 60 | throw new InvalidParameterException("low >= high"); |
| 61 | |
| 62 | int range = high - low + 1; |
| 63 | if(amount < low) |
| 64 | amount += range *((low - amount)/range + 1); |
| 65 | |
| 66 | return low + (amount - low)%range; |
| 67 | } |
| 68 | |
| 69 | public static float max(float a, float b, float c) |
| 70 | { |