LEFT | RIGHT |
1 // © 2017 and later: Unicode, Inc. and others. | 1 // © 2017 and later: Unicode, Inc. and others. |
2 // License & terms of use: http://www.unicode.org/copyright.html#License | 2 // License & terms of use: http://www.unicode.org/copyright.html#License |
3 package com.ibm.icu.impl.number; | 3 package com.ibm.icu.impl.number; |
4 | 4 |
5 import java.math.BigDecimal; | 5 import java.math.BigDecimal; |
6 import java.math.MathContext; | 6 import java.math.MathContext; |
7 import java.math.RoundingMode; | 7 import java.math.RoundingMode; |
8 | 8 |
9 import com.ibm.icu.impl.StandardPlural; | 9 import com.ibm.icu.impl.StandardPlural; |
10 import com.ibm.icu.text.PluralRules; | 10 import com.ibm.icu.text.PluralRules; |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 primaryPrecision = _other.primaryPrecision; | 270 primaryPrecision = _other.primaryPrecision; |
271 fallback = _other.fallback; | 271 fallback = _other.fallback; |
272 flags = _other.flags; | 272 flags = _other.flags; |
273 } | 273 } |
274 | 274 |
275 @Override | 275 @Override |
276 public long getPositionFingerprint() { | 276 public long getPositionFingerprint() { |
277 long fingerprint = 0; | 277 long fingerprint = 0; |
278 fingerprint ^= lOptPos; | 278 fingerprint ^= lOptPos; |
279 fingerprint ^= (lReqPos << 16); | 279 fingerprint ^= (lReqPos << 16); |
280 fingerprint ^= (rReqPos << 32); | 280 fingerprint ^= ((long) rReqPos << 32); |
281 fingerprint ^= (rOptPos << 48); | 281 fingerprint ^= ((long) rOptPos << 48); |
282 return fingerprint; | 282 return fingerprint; |
283 } | 283 } |
284 | 284 |
285 /** | 285 /** |
286 * Utility method to compute the number of digits ("precision") in a long. | 286 * Utility method to compute the number of digits ("precision") in a long. |
287 * | 287 * |
288 * @param input The long (which can't contain more than 19 digits). | 288 * @param input The long (which can't contain more than 19 digits). |
289 * @return The precision of the long. | 289 * @return The precision of the long. |
290 */ | 290 */ |
291 private static int computePrecision(long input) { | 291 private static int computePrecision(long input) { |
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
851 private static int toRange(int i, int lo, int hi) { | 851 private static int toRange(int i, int lo, int hi) { |
852 if (i < lo) { | 852 if (i < lo) { |
853 return lo; | 853 return lo; |
854 } else if (i > hi) { | 854 } else if (i > hi) { |
855 return hi; | 855 return hi; |
856 } else { | 856 } else { |
857 return i; | 857 return i; |
858 } | 858 } |
859 } | 859 } |
860 } | 860 } |
LEFT | RIGHT |