(n)
| 423 | return result.length == 1 ? result[0] : result |
| 424 | } |
| 425 | cos(n) { |
| 426 | if (n.isComplex) { |
| 427 | const a = n.a.toNumber() |
| 428 | const b = n.b.toNumber() |
| 429 | |
| 430 | const re = Math.cos(a) * Math.cosh(b) |
| 431 | const im = Math.sin(a) * Math.sinh(b) |
| 432 | |
| 433 | return this.complex(re, -im) |
| 434 | } |
| 435 | if (typeof n != 'object' || BigNumber.isBigNumber(n)) { |
| 436 | n = BigNumber.isBigNumber(n) == true ? n.toNumber() : n |
| 437 | n = [n] |
| 438 | } |
| 439 | let result = [] |
| 440 | for (var i = 0; i < n.length; i++) { |
| 441 | result.push(Math.cos(n[i]).toFixed(15)) |
| 442 | } |
| 443 | return result.length == 1 ? result[0] : result |
| 444 | } |
| 445 | cosh(n) { |
| 446 | if (n.isComplex) { |
| 447 | const a = n.a.toNumber() |
no test coverage detected