ICU-8854 Check for oddness that won't work for negative numbers.

X-SVN-Rev: 30928
This commit is contained in:
Abhinav Gupta 2011-11-04 15:19:31 +00:00
parent f613d3d4d9
commit 8c6de437fc
3 changed files with 5 additions and 5 deletions

View File

@ -1895,7 +1895,7 @@ public final class CollationElementIterator
// and add 5 (to avoid overlapping magic CE byte
// values). The last byte we subtract 1 to ensure it is
// less than all the other bytes.
if (digIndx % 2 == 1) {
if (digIndx % 2 != 0) {
collateVal += digVal;
// This removes trailing zeroes.
if (collateVal == 0 && trailingZeroIndex == 0) {
@ -2487,7 +2487,7 @@ public final class CollationElementIterator
// first digit encountered into the ones place and the
// second digit encountered into the tens place.
if (digIndx % 2 == 1){
if (digIndx % 2 != 0){
collateVal += digVal * 10;
// This removes leading zeroes.

View File

@ -9,7 +9,7 @@ import com.ibm.icu.lang.UCharacter;
/* ------------------------------------------------------------------ */
/* BigDecimal -- Decimal arithmetic for Java */
/* ------------------------------------------------------------------ */
/* Copyright IBM Corporation, 1996-2010. All Rights Reserved. */
/* Copyright IBM Corporation, 1996-2011. All Rights Reserved. */
/* */
/* The BigDecimal class provides immutable arbitrary-precision */
/* floating point (including integer) decimal numbers. */
@ -3697,7 +3697,7 @@ public class BigDecimal extends java.lang.Number implements java.io.Serializable
if ((!(allzero(oldmant, len + 1))))
increment = sign;
else /* 0.5000 */
if ((((mant[mant.length - 1]) % 2)) == 1)
if ((((mant[mant.length - 1]) % 2)) != 0)
increment = sign;
}
} else if (mode == ROUND_DOWN) {

View File

@ -666,7 +666,7 @@ public class UnicodeSet extends UnicodeFilter implements Iterable<String>, Compa
// number of backslashes, then it has been escaped.
// Before unescaping it, we delete the final
// backslash.
if ((backslashCount % 2) == 1) {
if (backslashCount % 2 != 0) {
result.setLength(result.length() - 1);
}
Utility.escapeUnprintable(result, c);