How to use the unaryMinus function from mathjs
Find comprehensive JavaScript mathjs.unaryMinus code examples handpicked from public code repositorys.
100 101 102 103 104 105 106 107 108 109
var c = poly.slice(0, end); // Remove small leading coefficients that introduce infinities function calc_d(coeff) { return math.unaryMinus(math.divide(coeff, c[0])); } var d = c.slice(1, c.length).map(calc_d); while (!d.every(isFinite)) { c = c.slice(1, c.length);
5 6 7 8 9 10 11 12 13 14
1, math.add( 1, math.dotPow( math.e, math.unaryMinus(z) ) ) ) }
GitHub: gravaman/fleish
![gravaman profile picture](/gravaman.png?size=40)
85 86 87 88 89 90 91 92 93 94
let [ base, exp ] = biggify(args) return math.pow(base, exp) }, neg(num) { num = math.bignumber(num) return math.unaryMinus(num) }, round(num, digits = 3) { num = math.bignumber(num) return math.round(num, digits)
mathjs.evaluate is the most popular function in mathjs (87200 examples)