code: function decCoefficientToBinaryString (x) {
    // Convert to string
    const a = x.d // array with digits
    let r = a[0] + ''
  
    for (let i = 1; i < a.length; ++i) {
      let s = a[i] + ''
      for (let z = 7 - s.length; z--;) {
        s = '0' + s
      }
  
      r += s
    }
  
    let j = r.length
    while (r.charAt(j) === '0') {
      j--
    }
  
    let xe = x.e
    let str = r.slice(0, j + 1 || 1)
    const strL = str.length
    if (xe > 0) {
      if (++xe > strL) {
        // Append zeros.
        xe -= strL
        while (xe--) {
          str += '0'
        }
      } else if (xe < strL) {
        str = str.slice(0, xe) + '.' + str.slice(xe)
      }
    }
  
    // Convert from base 10 (decimal) to base 2
    const arr = [0]
    for (let i = 0; i < str.length;) {
      let arrL = arr.length
      while (arrL--) {
        arr[arrL] *= 10
      }
  
      arr[0] += parseInt(str.charAt(i++)) // convert to int
      for (let j = 0; j < arr.length; ++j) {
        if (arr[j] > 1) {
          if (arr[j + 1] === null || arr[j + 1] === undefined) {
            arr[j + 1] = 0
          }
  
          arr[j + 1] += arr[j] >> 1
          arr[j] &= 1
        }
      }
    }
  
    return arr.reverse()
  }
docs: /* Extracted from decimal.js, and edited to specialize.