diff options
author | Mattias Andrée <maandree@operamail.com> | 2014-01-20 06:48:42 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2014-01-20 06:48:42 +0100 |
commit | a39a773489300ab932c06ed3cf8b7024863fc24d (patch) | |
tree | c0111c216dd8b8e7b6fe389acfd70c6f57c4b839 /src | |
parent | add hybrid version of sideways addition (diff) | |
download | algorithms-and-data-structures-a39a773489300ab932c06ed3cf8b7024863fc24d.tar.gz algorithms-and-data-structures-a39a773489300ab932c06ed3cf8b7024863fc24d.tar.bz2 algorithms-and-data-structures-a39a773489300ab932c06ed3cf8b7024863fc24d.tar.xz |
m
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/algorithms/bits/Bits.java | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/algorithms/bits/Bits.java b/src/algorithms/bits/Bits.java index 24ec464..8f794e3 100644 --- a/src/algorithms/bits/Bits.java +++ b/src/algorithms/bits/Bits.java @@ -236,11 +236,10 @@ public class Bits value -= (value >> 1) & £{L1}; value = (£{T})((value & £{L2}) + ((value >> 2) & £{L2})); - value = (value + (value >> 4)) & £{L3}; - value = (value * £{L4}) >> (($S - 1) * 8); + value = (£{T})((value + (value >> 4)) & £{L3}); + value = (£{T})((value * £{L4}) >> ((£{S} - 1) * 8)); return value; /* Only applicable upto 128 bits */ } - £>done } |