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
28 lines (22 loc) • 570 B
JavaScript
const signature1 = 'BigNumber'
const signature2 = 'BigNumber, BigNumber'
export function absBigNumber (a) {
return a.abs()
}
absBigNumber.signature = signature1
export function addBigNumber (a, b) {
return a.add(b)
}
addBigNumber.signature = signature2
export function subtractBigNumber (a, b) {
return a.sub(b)
}
subtractBigNumber.signature = signature2
export function multiplyBigNumber (a, b) {
return a.mul(b)
}
multiplyBigNumber.signature = signature2
export function divideBigNumber (a, b) {
return a.div(b)
}
divideBigNumber.signature = signature2