code: function snapFactorTo(v, arr, snapType) {
      // 假设 v = -512,isFloor = true
      if (isNaN(v)) {
        return NaN;
      }
      var factor = 1; // 计算系数
      if (v !== 0) {
        if (v < 0) {
          factor = -1;
        }
        v = v * factor; // v = 512
        var tmpFactor = getFactor(v);
        factor = factor * tmpFactor; // factor = -100
  
        v = v / tmpFactor; // v = 5.12
      }
      if (snapType === 'floor') {
        v = Util.snapFloor(arr, v); // v = 5
      } else if (snapType === 'ceil') {
        v = Util.snapCeiling(arr, v); // v = 6
      } else {
        v = Util.snapTo(arr, v); // 四舍五入 5
      }
      var rst = v * factor;
      // 如果出现浮点数计算问题，需要处理一下
      if (Math.abs(factor) < 1 && rst.toString().length > DECIMAL_LENGTH) {
        var decimalVal = parseInt(1 / factor);
        var symbol = factor > 0 ? 1 : -1;
        rst = v / decimalVal * symbol;
      }
      return rst;
    }
docs: 获取逼近的数值