You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

33 lines
726 B

const $math = require('mathjs')
export const math = {
add (a,b) {
return $math.format(
$math.add(
$math.bignumber(a),$math.bignumber(b)
)
)
},
subtract(a,b) {
return $math.format(
$math.subtract(
$math.bignumber(a),$math.bignumber(b)
)
)
},
multiply (a,b) {
return $math.format(
$math.multiply(
$math.bignumber(a),$math.bignumber(b)
)
)
},
divide(a,b) {
return $math.format(
$math.divide(
$math.bignumber(a),$math.bignumber(b)
)
)
}
}