UNPKG

logiq

Version:

Awesome logical and bitwise operators with support for TypedArrays

19 lines (18 loc) 498 B
import { makeConnectives } from './utils.js'; function not(p) { /* eslint-disable-next-line no-bitwise */ return ~BigInt(p); } function and(p, q) { /* eslint-disable-next-line no-bitwise */ return BigInt(p) & BigInt(q); } function or(p, q) { /* eslint-disable-next-line no-bitwise */ return BigInt(p) | BigInt(q); } function xor(p, q) { /* eslint-disable-next-line no-bitwise */ return BigInt(p) ^ BigInt(q); } export default makeConnectives({ not, and, or, xor });