Skip to content

Commit

Permalink
Fix bitwise and in ccalc
Browse files Browse the repository at this point in the history
  • Loading branch information
Earthcomputer committed Aug 29, 2023
1 parent 8af5e29 commit 02244d1
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down

0 comments on commit 02244d1

Please sign in to comment.