1 | "use strict";
|
2 |
|
3 | exports.__esModule = true;
|
4 | exports["default"] = void 0;
|
5 | function factorial(a) {
|
6 | if (a % 1 || !(+a >= 0)) return NaN;
|
7 | if (a > 170) return Infinity;else if (a === 0) return 1;else {
|
8 | return a * factorial(a - 1);
|
9 | }
|
10 | }
|
11 | function power(a, b) {
|
12 | return Math.pow(a, b);
|
13 | }
|
14 | function sqrt(a) {
|
15 | return Math.sqrt(a);
|
16 | }
|
17 | var exponentialSymbols = {
|
18 | symbols: {
|
19 | '!': {
|
20 | postfix: {
|
21 | symbol: '!',
|
22 | f: factorial,
|
23 | notation: 'postfix',
|
24 | precedence: 6,
|
25 | rightToLeft: 0,
|
26 | argCount: 1
|
27 | },
|
28 | symbol: '!',
|
29 | regSymbol: '!'
|
30 | },
|
31 | '^': {
|
32 | infix: {
|
33 | symbol: '^',
|
34 | f: power,
|
35 | notation: 'infix',
|
36 | precedence: 5,
|
37 | rightToLeft: 1,
|
38 | argCount: 2
|
39 | },
|
40 | symbol: '^',
|
41 | regSymbol: '\\^'
|
42 | },
|
43 | sqrt: {
|
44 | func: {
|
45 | symbol: 'sqrt',
|
46 | f: sqrt,
|
47 | notation: 'func',
|
48 | precedence: 0,
|
49 | rightToLeft: 0,
|
50 | argCount: 1
|
51 | },
|
52 | symbol: 'sqrt',
|
53 | regSymbol: 'sqrt\\b'
|
54 | }
|
55 | }
|
56 | };
|
57 | var _default = exports["default"] = exponentialSymbols;
|
58 | module.exports = exports.default; |
\ | No newline at end of file |