MCPcopy Create free account
hub / github.com/KAlO2/PerfectShow / wrap

Method wrap

src/com/cloudream/ishow/util/MathUtils.java:57–67  ·  view source on GitHub ↗
(int amount, int low, int high)

Source from the content-addressed store, hash-verified

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 {

Callers 1

onProgressChangedMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected