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