(y: BigDecimal | number | string | bigint)
| 229 | // --- Arithmetic --- |
| 230 | |
| 231 | times(y: BigDecimal | number | string | bigint): BigDecimal { |
| 232 | const other = BigDecimal._coerce(y) |
| 233 | if (this._special || other._special) { |
| 234 | return this._specialArith(other, 'times') |
| 235 | } |
| 236 | if (this._mantissa === 0n || other._mantissa === 0n) { |
| 237 | const negZero = this._isSignNegative() |
| 238 | ? !other._isSignNegative() |
| 239 | : other._isSignNegative() |
| 240 | return BigDecimal._create(0n, 0, SpecialValue.NONE, negZero) |
| 241 | } |
| 242 | const m = this._mantissa * other._mantissa |
| 243 | const e = this._exponent + other._exponent |
| 244 | const [nm, ne] = removeTrailingZeros(m, e) |
| 245 | return BigDecimal._create(nm, ne, SpecialValue.NONE, false) |
| 246 | } |
| 247 | |
| 248 | div(y: BigDecimal | number | string | bigint): BigDecimal { |
| 249 | const other = BigDecimal._coerce(y) |
no test coverage detected