Changeset 3711 in josm for trunk/src/org/openstreetmap/josm/tools/Utils.java
- Timestamp:
- 2010-12-11T12:48:20+01:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/Utils.java
r3674 r3711 27 27 } 28 28 } 29 30 /** 31 * return the modulus in the range [0, n) 32 */ 33 public static int mod(int a, int n) { 34 if (n <= 0) 35 throw new IllegalArgumentException(); 36 int res = a % n; 37 if (res < 0) { 38 res += n; 39 } 40 return res; 41 } 42 29 43 }
Note:
See TracChangeset
for help on using the changeset viewer.