aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-01-20 06:48:42 +0100
committerMattias Andrée <maandree@operamail.com>2014-01-20 06:48:42 +0100
commita39a773489300ab932c06ed3cf8b7024863fc24d (patch)
treec0111c216dd8b8e7b6fe389acfd70c6f57c4b839 /src
parentadd hybrid version of sideways addition (diff)
downloadalgorithms-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.java5
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
}