1 | "use strict";
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports.createTanh = void 0;
|
7 |
|
8 | var _factory = require("../../utils/factory");
|
9 |
|
10 | var _collection = require("../../utils/collection");
|
11 |
|
12 | var _number = require("../../utils/number");
|
13 |
|
14 | var name = 'tanh';
|
15 | var dependencies = ['typed'];
|
16 | var createTanh = (0, _factory.factory)(name, dependencies, function (_ref) {
|
17 | var typed = _ref.typed;
|
18 |
|
19 | |
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 | var tanh = typed('tanh', {
|
44 | number: _number.tanh,
|
45 | Complex: function Complex(x) {
|
46 | return x.tanh();
|
47 | },
|
48 | BigNumber: function BigNumber(x) {
|
49 | return x.tanh();
|
50 | },
|
51 | Unit: function Unit(x) {
|
52 | if (!x.hasBase(x.constructor.BASE_UNITS.ANGLE)) {
|
53 | throw new TypeError('Unit in function tanh is no angle');
|
54 | }
|
55 |
|
56 | return tanh(x.value);
|
57 | },
|
58 | 'Array | Matrix': function ArrayMatrix(x) {
|
59 |
|
60 | return (0, _collection.deepMap)(x, tanh, true);
|
61 | }
|
62 | });
|
63 | return tanh;
|
64 | });
|
65 | exports.createTanh = createTanh; |
\ | No newline at end of file |