diff options
author | Mattias Andrée <maandree@operamail.com> | 2014-01-20 07:01:09 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2014-01-20 07:01:09 +0100 |
commit | 8540e4d3051a1aa6a2fa9686c47b884a3df23cf7 (patch) | |
tree | fdd852108efc67df397e5fddd9be86727793a399 /src | |
parent | some parity computations (diff) | |
download | algorithms-and-data-structures-8540e4d3051a1aa6a2fa9686c47b884a3df23cf7.tar.gz algorithms-and-data-structures-8540e4d3051a1aa6a2fa9686c47b884a3df23cf7.tar.bz2 algorithms-and-data-structures-8540e4d3051a1aa6a2fa9686c47b884a3df23cf7.tar.xz |
m
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/algorithms/bits/Bits.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/algorithms/bits/Bits.java b/src/algorithms/bits/Bits.java index 493e16d..3dfeca4 100644 --- a/src/algorithms/bits/Bits.java +++ b/src/algorithms/bits/Bits.java @@ -295,7 +295,7 @@ public class Bits value ^= value >> 3; value ^= value >> 2; value ^= value >> 1; - return value & 1; + return (£{T})(value & 1); } /** @@ -304,7 +304,7 @@ public class Bits * @param value The interger * @return The parity */ - public static char parity_table(£{T} value) + public static byte parity_table(£{T} value) { £>(( $S > 4 )) && value ^= value >> 32; @@ -312,7 +312,7 @@ public class Bits value ^= value >> 16; £>(( $S > 1 )) && value ^= value >> 8; - return PARITY_TABLE_256[rc]; + return PARITY_TABLE_256[(int)value]; } £>done } |