UNPKG

819 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3var tslib_1 = require("tslib");
4var math_helper_js_1 = tslib_1.__importDefault(require("./math-helper.js"));
5var mathFunctions = {
6 // name, unit
7 ceil: null,
8 floor: null,
9 sqrt: null,
10 abs: null,
11 tan: '',
12 sin: '',
13 cos: '',
14 atan: 'rad',
15 asin: 'rad',
16 acos: 'rad'
17};
18for (var f in mathFunctions) {
19 if (mathFunctions.hasOwnProperty(f)) {
20 mathFunctions[f] = math_helper_js_1.default.bind(null, Math[f], mathFunctions[f]);
21 }
22}
23mathFunctions.round = function (n, f) {
24 var fraction = typeof f === 'undefined' ? 0 : f.value;
25 return math_helper_js_1.default(function (num) { return num.toFixed(fraction); }, null, n);
26};
27exports.default = mathFunctions;
28//# sourceMappingURL=math.js.map
\No newline at end of file