forked from cryptobuks1/JsWallet
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmath.js
More file actions
25 lines (25 loc) · 649 Bytes
/
math.js
File metadata and controls
25 lines (25 loc) · 649 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Generated by LiveScript 1.6.0
(function(){
var bignumber, ref$, map, pairsToObj, math;
bignumber = require('bignumber.js');
ref$ = require('prelude-ls'), map = ref$.map, pairsToObj = ref$.pairsToObj;
math = function($){
return function(x, y){
var err;
if (x === '..' || y === '..') {
return '..';
}
try {
return new bignumber(x)[$](y).toFixed();
} catch (e$) {
err = e$;
throw x + " " + $ + " " + y + " = " + err;
}
};
};
module.exports = pairsToObj(
map(function(it){
return [it, math(it)];
})(
['plus', 'minus', 'times', 'div']));
}).call(this);