mathjs
Version:
Math.js is an extensive math library for JavaScript and Node.js. It features a flexible expression parser with support for symbolic computation, comes with a large set of built-in functions and constants, and offers an integrated solution to work with dif
69 lines (67 loc) • 2.27 kB
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.createBitAnd = void 0;
var _bitwise = require("../../utils/bignumber/bitwise.js");
var _matAlgo02xDS = require("../../type/matrix/utils/matAlgo02xDS0.js");
var _matAlgo11xS0s = require("../../type/matrix/utils/matAlgo11xS0s.js");
var _matAlgo06xS0S = require("../../type/matrix/utils/matAlgo06xS0S0.js");
var _factory = require("../../utils/factory.js");
var _matrixAlgorithmSuite = require("../../type/matrix/utils/matrixAlgorithmSuite.js");
var _index = require("../../plain/number/index.js");
var name = 'bitAnd';
var dependencies = ['typed', 'matrix', 'equalScalar', 'concat'];
var createBitAnd = exports.createBitAnd = /* #__PURE__ */(0, _factory.factory)(name, dependencies, function (_ref) {
var typed = _ref.typed,
matrix = _ref.matrix,
equalScalar = _ref.equalScalar,
concat = _ref.concat;
var matAlgo02xDS0 = (0, _matAlgo02xDS.createMatAlgo02xDS0)({
typed: typed,
equalScalar: equalScalar
});
var matAlgo06xS0S0 = (0, _matAlgo06xS0S.createMatAlgo06xS0S0)({
typed: typed,
equalScalar: equalScalar
});
var matAlgo11xS0s = (0, _matAlgo11xS0s.createMatAlgo11xS0s)({
typed: typed,
equalScalar: equalScalar
});
var matrixAlgorithmSuite = (0, _matrixAlgorithmSuite.createMatrixAlgorithmSuite)({
typed: typed,
matrix: matrix,
concat: concat
});
/**
* Bitwise AND two values, `x & y`.
* For matrices, the function is evaluated element wise.
*
* Syntax:
*
* math.bitAnd(x, y)
*
* Examples:
*
* math.bitAnd(53, 131) // returns number 1
*
* math.bitAnd([1, 12, 31], 42) // returns Array [0, 8, 10]
*
* See also:
*
* bitNot, bitOr, bitXor, leftShift, rightArithShift, rightLogShift
*
* @param {number | BigNumber | Array | Matrix} x First value to and
* @param {number | BigNumber | Array | Matrix} y Second value to and
* @return {number | BigNumber | Array | Matrix} AND of `x` and `y`
*/
return typed(name, {
'number, number': _index.bitAndNumber,
'BigNumber, BigNumber': _bitwise.bitAndBigNumber
}, matrixAlgorithmSuite({
SS: matAlgo06xS0S0,
DS: matAlgo02xDS0,
Ss: matAlgo11xS0s
}));
});
;