1.0.15 • Published 4 years ago

exec-mathexpress v1.0.15

Weekly downloads
9
License
ISC
Repository
-
Last release
4 years ago

##js解析数学公式

const execMathExpress=require('exec-mathexpress');

console.log(execMathExpress('(1/2)*(2/3)/((1/2)*(2/3)+(1/2)*(2/3)))'))

//贝叶斯 条件概率 SW=WS*S/(WS*S+WH*H);(只用于二分类)
console.log(execMathExpress('WS*S/(WS*S+WH*H)',{
    WS:'1/2',
    S:'1/4',
    WH:'1/2',
    H:'3/4'
}))
//->Fraction { num: 1, den: 4 }

//贝叶斯联合概率(只用于二分类)
console.log(execMathExpress('P0*P1*P2/(P0*P1*P2+(1-P0)*(1-P1)*(1-P2))',
    { P0: '1/2', P1: '2/3', P2: '3/4' }
))
//->Fraction { num: 6, den: 7 }
1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago