function fn_click(p){
var a , b;
a=0.7;
b=0.1;
if(p==1){
alert(a+b);
}else if(p==2){
alert(eval("a+b"));
}else if(p==3){
math.config({
number: 'BigNumber'
});
var result = math.parser().eval(a + "+" + b)
alert(result);
}
}
<input type="button" value="0.7+0.1" onclick="fn_click(1);" />
<input type="button" value="eval(0.7+0.1)" onclick="fn_click(2);" />
<input type="button" value="mathjs(0.7+0.1)" onclick="fn_click(3);" />