128. BigDecimal multiplication

JavaScriptAlgorithm

medium  - accepted / - tried

This is a follow-up on 126. BigDecimal addition

In this problem, you are asked to implement the multiplication of two decimals with arbitrary digits.


multiply(
  '1123456787654323456789', 
  '1234567887654323456'
)
// '1386983673205309924427166592431045142784'

multiply(
  '-1123456787654323456789', 
  '1234567887654323456.12348'
)
// '-1386983673205309924565891036570601003228.30572'

multiply(
  '-0.12345', 
  '-1.6789012'
)
// '0.20726035314'
  1. This problem covers 114. implement BigInt multiplication.
  2. trailing zeroes in the result should be removed.
  3. Big.js defaults return exponential notation when it is too big, in this problem, don't do that

Think about the edge cases.

(2)