From 02244d1e154ad2cc82ac0f0006e5059f9b6aa9d5 Mon Sep 17 00:00:00 2001 From: Joe Date: Tue, 29 Aug 2023 16:45:14 +0100 Subject: [PATCH] Fix bitwise and in ccalc --- .../command/arguments/ExpressionArgumentType.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/net/earthcomputer/clientcommands/command/arguments/ExpressionArgumentType.java b/src/main/java/net/earthcomputer/clientcommands/command/arguments/ExpressionArgumentType.java index 9f7d03000..b24ae4852 100644 --- a/src/main/java/net/earthcomputer/clientcommands/command/arguments/ExpressionArgumentType.java +++ b/src/main/java/net/earthcomputer/clientcommands/command/arguments/ExpressionArgumentType.java @@ -432,7 +432,7 @@ public boolean isAcceptableInputCount(int count) { } }) .put("acoth", (UnaryFunction) n -> 0.5 * Math.log((n + 1) / (n - 1))) - .put("and", (TwoOrMoreFunction) vals -> (double)Arrays.stream(vals).mapToInt(val -> (int) val).reduce(0, (a, b) -> a & b)) + .put("and", (TwoOrMoreFunction) vals -> (double)Arrays.stream(vals).mapToInt(val -> (int) val).reduce(~0, (a, b) -> a & b)) .put("or", (TwoOrMoreFunction) vals -> (double)Arrays.stream(vals).mapToInt(val -> (int) val).reduce(0, (a, b) -> a | b)) .put("xor", (TwoOrMoreFunction) vals -> (double)Arrays.stream(vals).mapToInt(val -> (int) val).reduce(0, (a, b) -> a ^ b)) .put("not", (UnaryFunction) val -> (double)(~((int)val)))