UNPKG

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

68 lines (66 loc) 2.22 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.createBitXor = void 0; var _bitwise = require("../../utils/bignumber/bitwise.js"); var _matAlgo03xDSf = require("../../type/matrix/utils/matAlgo03xDSf.js"); var _matAlgo07xSSf = require("../../type/matrix/utils/matAlgo07xSSf.js"); var _matAlgo12xSfs = require("../../type/matrix/utils/matAlgo12xSfs.js"); var _factory = require("../../utils/factory.js"); var _matrixAlgorithmSuite = require("../../type/matrix/utils/matrixAlgorithmSuite.js"); var _index = require("../../plain/number/index.js"); var name = 'bitXor'; var dependencies = ['typed', 'matrix', 'DenseMatrix', 'concat']; var createBitXor = exports.createBitXor = /* #__PURE__ */(0, _factory.factory)(name, dependencies, function (_ref) { var typed = _ref.typed, matrix = _ref.matrix, DenseMatrix = _ref.DenseMatrix, concat = _ref.concat; var matAlgo03xDSf = (0, _matAlgo03xDSf.createMatAlgo03xDSf)({ typed: typed }); var matAlgo07xSSf = (0, _matAlgo07xSSf.createMatAlgo07xSSf)({ typed: typed, DenseMatrix: DenseMatrix }); var matAlgo12xSfs = (0, _matAlgo12xSfs.createMatAlgo12xSfs)({ typed: typed, DenseMatrix: DenseMatrix }); var matrixAlgorithmSuite = (0, _matrixAlgorithmSuite.createMatrixAlgorithmSuite)({ typed: typed, matrix: matrix, concat: concat }); /** * Bitwise XOR two values, `x ^ y`. * For matrices, the function is evaluated element wise. * * Syntax: * * math.bitXor(x, y) * * Examples: * * math.bitXor(1, 2) // returns number 3 * * math.bitXor([2, 3, 4], 4) // returns Array [6, 7, 0] * * See also: * * bitAnd, bitNot, bitOr, leftShift, rightArithShift, rightLogShift * * @param {number | BigNumber | Array | Matrix} x First value to xor * @param {number | BigNumber | Array | Matrix} y Second value to xor * @return {number | BigNumber | Array | Matrix} XOR of `x` and `y` */ return typed(name, { 'number, number': _index.bitXorNumber, 'BigNumber, BigNumber': _bitwise.bitXor }, matrixAlgorithmSuite({ SS: matAlgo07xSSf, DS: matAlgo03xDSf, Ss: matAlgo12xSfs })); });