I have a very strange problem.
This statement:
const attacks: u64 =
data.get_rook_attacks(king_sq, occ) & pos.queens_rooks(them) |
data.get_bishop_attacks(king_sq, occ) & pos.queens_bishops(them);
gives a different result then this one (watch the brackets).
const attacks: u64 =
(data.get_rook_attacks(king_sq, occ) & pos.queens_rooks(them)) |
(data.get_bishop_attacks(king_sq, occ) & pos.queens_bishops(them));
The last one gives the correct result.
All the called functions return a u64
.
Am I missing something? Has |
not lower precedence than &
??
Or is the compiler freaking (which I cannot imagine is true).