1.0.15 • Published 5 years ago

exec-mathexpress v1.0.15

Weekly downloads
9
License
ISC
Repository
-
Last release
5 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

5 years ago

1.0.14

5 years ago

1.0.13

5 years ago

1.0.12

5 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago