aboutsummaryrefslogtreecommitdiffstats
path: root/src/algorithms/bits/Absolute.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/algorithms/bits/Absolute.java')
-rw-r--r--src/algorithms/bits/Absolute.java7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/algorithms/bits/Absolute.java b/src/algorithms/bits/Absolute.java
index 2e694eb..b1c29f4 100644
--- a/src/algorithms/bits/Absolute.java
+++ b/src/algorithms/bits/Absolute.java
@@ -33,10 +33,9 @@ public class Absolute
*/
public static £{T} abs(£{T} value)
{
- £{T} mask;;
- return (value ^ (mask = value >> £{S})) - mask;
- /* Or alternatively:
- * (v + (mask = value >> £{S})) ^ mask
+ £{T} mask;
+ return (£{T})((value ^ (mask = (£{T})(value >> £{S}))) - mask);
+ /* Or alternatively make the ^ into an +, and the - into a ^.
*/
}
£>done