math: implement full math
This commit is contained in:
parent
3b65f4f7a6
commit
e50880622e
2 changed files with 4 additions and 9 deletions
|
|
@ -1,6 +1,6 @@
|
|||
var _widgets_base = require('../common/_widgets_base'),
|
||||
{widgetManager} = require('../../managers'),
|
||||
{mathEval} = require('../utils')
|
||||
{math} = require('../utils')
|
||||
|
||||
|
||||
module.exports = class Formula extends _widgets_base {
|
||||
|
|
@ -83,7 +83,7 @@ module.exports = class Formula extends _widgets_base {
|
|||
|
||||
try {
|
||||
|
||||
this.value = mathEval(formula).valueOf()
|
||||
this.value = math.eval(formula).valueOf()
|
||||
|
||||
this.showValue()
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,4 @@
|
|||
var core = require('mathjs/core'),
|
||||
math = core.create()
|
||||
|
||||
math.import(require('mathjs/lib/type'))
|
||||
math.import(require('mathjs/lib/function'))
|
||||
math.import(require('mathjs/lib/expression'))
|
||||
var math = require('mathjs')
|
||||
|
||||
module.exports = {
|
||||
|
||||
|
|
@ -77,5 +72,5 @@ module.exports = {
|
|||
return hsb
|
||||
},
|
||||
|
||||
mathEval: math.eval
|
||||
math: math
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue