(n)
| 129 | return new BigNumber(new BigNumber(1).div(this.pow(this.c("e", n), x).plus(1)).toFixed(n)) |
| 130 | } |
| 131 | sqrt(n) { |
| 132 | if (typeof n != 'object' || BigNumber.isBigNumber(n)) { |
| 133 | n = [n] |
| 134 | } |
| 135 | let result = [] |
| 136 | for (var i = 0; i < n.length; i++) { |
| 137 | if (new BigNumber(n[i]).lt(0)) { |
| 138 | result.push(this.complex(0, new BigNumber(n[i]).abs().sqrt())) |
| 139 | } else { |
| 140 | result.push(new BigNumber(new BigNumber(n[i]).sqrt())) |
| 141 | } |
| 142 | } |
| 143 | return result.length == 1 ? result[0] : result |
| 144 | } |
| 145 | apply(n, f) { |
| 146 | if (typeof n != 'object') { |
| 147 | n = [n] |
no test coverage detected