1 | import { factory } from '../../utils/factory';
|
2 | import { deepMap } from '../../utils/collection';
|
3 | var name = 'acos';
|
4 | var dependencies = ['typed', 'config', 'Complex'];
|
5 | export var createAcos =
|
6 |
|
7 | factory(name, dependencies, function (_ref) {
|
8 | var typed = _ref.typed,
|
9 | config = _ref.config,
|
10 | Complex = _ref.Complex;
|
11 |
|
12 | |
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 | var acos = typed(name, {
|
36 | number: function number(x) {
|
37 | if (x >= -1 && x <= 1 || config.predictable) {
|
38 | return Math.acos(x);
|
39 | } else {
|
40 | return new Complex(x, 0).acos();
|
41 | }
|
42 | },
|
43 | Complex: function Complex(x) {
|
44 | return x.acos();
|
45 | },
|
46 | BigNumber: function BigNumber(x) {
|
47 | return x.acos();
|
48 | },
|
49 | 'Array | Matrix': function ArrayMatrix(x) {
|
50 | return deepMap(x, acos);
|
51 | }
|
52 | });
|
53 | return acos;
|
54 | }); |
\ | No newline at end of file |