feat:node-modules
This commit is contained in:
50
node_modules/mathjs/lib/cjs/function/string/bin.js
generated
vendored
Normal file
50
node_modules/mathjs/lib/cjs/function/string/bin.js
generated
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.createBin = void 0;
|
||||
var _factory = require("../../utils/factory.js");
|
||||
const name = 'bin';
|
||||
const dependencies = ['typed', 'format'];
|
||||
|
||||
/**
|
||||
* Format a number as binary.
|
||||
*
|
||||
* Syntax:
|
||||
*
|
||||
* math.bin(value)
|
||||
*
|
||||
* Examples:
|
||||
*
|
||||
* //the following outputs "0b10"
|
||||
* math.bin(2)
|
||||
*
|
||||
* See also:
|
||||
*
|
||||
* oct
|
||||
* hex
|
||||
*
|
||||
* @param {number | BigNumber} value Value to be stringified
|
||||
* @param {number | BigNumber} wordSize Optional word size (see `format`)
|
||||
* @return {string} The formatted value
|
||||
*/
|
||||
const createBin = exports.createBin = (0, _factory.factory)(name, dependencies, _ref => {
|
||||
let {
|
||||
typed,
|
||||
format
|
||||
} = _ref;
|
||||
return typed(name, {
|
||||
'number | BigNumber': function (n) {
|
||||
return format(n, {
|
||||
notation: 'bin'
|
||||
});
|
||||
},
|
||||
'number | BigNumber, number | BigNumber': function (n, wordSize) {
|
||||
return format(n, {
|
||||
notation: 'bin',
|
||||
wordSize
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user