PX => REM四舍五入的处理
975394
function(num){
        // 非法值默认处理为none
        if(config.rounding !== 'none' && !Math[config.rounding]){
            config.rounding = 'none'
        }

        return config.rounding === 'none' ?
            // 如果为true，不进行四舍五入，默认浏览器去处理
            (num/config.constant *100)/100 :
            // 如果为false，调用Math方法
            Math[config.rounding](num/config.constant *100)/100;
    }
1351315
function pnorm(qn) {
        var b = [1.570796288, 0.03706987906, -0.8364353589e-3,
                -0.2250947176e-3, 0.6841218299e-5, 0.5824238515e-5,
                -0.104527497e-5, 0.8360937017e-7, -0.3231081277e-8,
                0.3657763036e-10, 0.6936233982e-12],
            w1 = qn,
            w3 = -Math.log(4.0 * w1 * (1.0 - w1)),
            i = 1;

        if (qn < 0.0 || qn > 1.0) { return 0.0; }
        if (qn === 0.5) { return 0.0; }
        if (qn > 0.5) { w1 = 1.0 - w1; }

        w1 = b[0];
        for (i; i < 11; i++) {
            w1 += b[i] * Math.pow(w3, i);
        }

        if (qn > 0.5) { return Math.sqrt(w1 * w3); }

        return -Math.sqrt(w1 * w3);
    }
346340
def px_to_pt(self, px):
        """"""
        if px < 200:
            pt = self.PX_TO_PT[px]
        else:
            pt = int(floor((px - 1.21) / 1.332))

        return pt
390582
function convertFormatNumber (value, num) {
  // 序数
  if (num === 0) {
    return suji(value, '序数');
  }
  // 0埋め
  if (typeof value === 'number') {
    value = value + '';
    return value.length < num ? ('000000000' + value).slice(-num) : value;
  }
  // 切り捨て
  return num && num < value.length ? value.substring(0, num) : value;
}
566030
public static long getRotatedX(final long pX, final long pY,
                                   final long pCenterX, final long pCenterY,
                                   final double pCos, final double pSin) {
        return pCenterX + Math.round((pX - pCenterX) * pCos - (pY - pCenterY) * pSin);
    }
377102
def convert_to_int(value):
    
    if not value:
        return None

    # Apart from numbers also accept values that end with px
    if isinstance(value, str):
        value = value.strip(' px')

    try:
        return int(value)
    except (TypeError, ValueError):
        return None
1049989
function(param) {
      var step, start, res;
      //如果无参数 当成是获取第一个元素
      if (!param || !(param = param.replace(/\s+/g, ""))) {
        return {
          start: 1,
          step: 0
        };
      }
      if (res = nthCache.get(param)) return res;
      // 对even odd等转化为标准的a，b组合(即step与start)
      if (param == "even") {
        start = 2;
        step = 2;
      } else if (param == "odd") {
        step = 2;
        start = 1;
      } else {
        res = param.match(nthValueReg);
        // 对错误的nth参数抛出错误
        if (!res) step = null; // 无论其他参数，如果step为null，则永远为false
        else {
          if (res[1]) {
            step = 0;
            start = parseInt(res[1]);
          } else {
            if (res[2] == "-") res[2] = "-1";
            step = res[2] ? parseInt(res[2]) : 1;
            start = res[3] ? parseInt(res[3]) : 0;
          }
        }
      }
      if (start < 1) {
        if (step < 1) {
          step = null; //标志false
        } else {
          start = -(-start) % step + step;
        }
      }
      return nthCache.set(param, {
        start: start,
        step: step
      });
    }
184869
private static int getXIndex(PatternFinderUser def, int x,
            Segment<PrimitiveParameter> lastMatch) {
        int skipStart = def.getSkipStart();
        if (lastMatch != null && skipStart > 0) {
            return Math.max(x, lastMatch.getFirstIndex() + skipStart);
        } else if (lastMatch != null && def.getSkip() > 0) {
            return Math.max(x, lastMatch.getLastIndex() + def.getSkip());
        } else {
            return x;
        }
    }
903686
function percentPx(parentWd, WD, noNeg) {
        var wd = WD || 0; // ensure it is number  // null --> 0

        if (wd >= 1 || wd == 0) return wd;else if (wd <= -1) return noNeg ? 0 : wd;else if (typeof parentWd != 'number') return null;else if (wd >= 0.9999) // 100%
          return parentWd;else if (wd >= 0) return wd * parentWd;else {
          if (noNeg) return 0;
          if (wd > -0.9999) return wd * parentWd;else return -parentWd; // -100%
        }
      }
264507
function redundant(prev, p, next) {

            // 是否重合的点, 只有两个点同在曲线上或者同不在曲线上移出
            if (
                (p.onCurve && next.onCurve || !p.onCurve && !next.onCurve)
                && Math.pow(p.x - next.x, 2) + Math.pow(p.y - next.y, 2) <= 1
            ) {
                return true;
            }

            // 三点同线 检查直线点
            if (
                (p.onCurve && prev.onCurve && next.onCurve)
                && Math.abs((next.y - p.y) * (prev.x - p.x) - (prev.y - p.y) * (next.x - p.x)) <= 0.001
            ) {
                return true;
            }

            // 三点同线 检查控制点
            if (
                (!p.onCurve && prev.onCurve && next.onCurve)
                && Math.abs((next.y - p.y) * (prev.x - p.x) - (prev.y - p.y) * (next.x - p.x)) <= 0.001
            ) {
                return true;
            }

            return false;
        }
738417
public static int ipowi(int x, int p) {
    if(p <= 2) {
      return (int) FastMath.powFast(x, p);
    }
    int tmp = x, ret = (p & 1) == 1 ? x : 1;
    while(true) {
      tmp *= tmp;
      p >>= 1;
      if(p == 1) {
        return ret * tmp;
      }
      if((p & 1) != 0) {
        ret *= tmp;
      }
    }
  }
426134
function _num2ja(num, opt) {
    var sign = {
        "+": "",
        "-": "−"
    };
    var zero = "零";
    var point = "点";
    var zero2nine = ["〇", "一", "二", "三", "四", "五", "六", "七", "八", "九"];
    var ten2thou = ["", "十", "百", "千"];
    var suffices = [
        "",
        "万",
        "億",
        "兆",
        "京",
        "垓",
        "禾予",
        "穣",
        "溝",
        "澗",
        "正",
        "載,",
        "極",
        "恒河沙",
        "阿僧祇",
        "那由他",
        "不可思議",
        "無量大数"
    ];

    num = num.replace(/,/g, "");
    num.match(/([+-])?(\d+)(?:\.(\d+))?/i);
    var sig = RegExp.$1;
    var int = RegExp.$2;
    var fract = RegExp.$3;
    var seisuu = "";
    var shins = [];

    for (let i = int.length; i > 0; i -= 4) {
        shins.push(int.substring(i, i - 4));
    }
    if (shins.length >= 18) {
        return suffices[17];
    }

    var suffix = 0;
    for (let i = 0; i < shins.length; i++) {
        var shin = shins[i];
        if (shin == "0000") {
            suffix++;
            continue;
        }
        var sens = "";
        var keta = 0;
        var digits = shin.split("").reverse();
        for (var j = 0; j < digits.length; j++) {
            var digit = digits[j];

            if (opt["fixed4"] || opt["with_arabic"]) {
                if (opt["with_arabic"]) {
                    var flg = 0;
                    // 余分な 0 を削除する
                    if (digit == "0") {
                        for (var k = j + 1; k < digits.length; k++) {
                            flg += digits[k] == "0" ? 0 : 1;
                        }
                        if (flg == 0) {
                            digit = "";
                        }
                    }
                    sens = digit + sens;
                } else {
                    sens = zero2nine[digit] + sens;
                }
            } else {
                var suuji = digit == 1 && !opt["p_one"] && keta > 0 ? "" : zero2nine[digit];
                if (digit != 0) {
                    sens = suuji + ten2thou[keta] + sens;
                }
            }
            keta++;
        }
        seisuu = sens + suffices[suffix++] + seisuu;
    }
    var result = (sign[sig] || "") + seisuu;
    result = result || zero;
    if (fract) {
        result = result + point + fract;
    }
    return result;
}
560794
def int2str(num, radix=10, alphabet=BASE85):
    """"""
    return NumConv(radix, alphabet).int2str(num)
266267
def dx(mt, x):
     
    end_x_val = mt.lx.index(0)
    if x < end_x_val:  
        return mt.lx[x] - mt.lx[x + 1]
    else:
        return 0.0
723531
def dim_dm(self, pars):
        
        """
        self._set_parameters(pars)
        numerator = -self.otc * np.sin(self.ang)
        result = numerator / self.denom
        result *= self.rho0
        return result
454310
private int dpToPx(float dp) {
        final DisplayMetrics displayMetrics = getContext().getResources().getDisplayMetrics();
        float px = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, displayMetrics);
        return Math.round(px);
    }
540179
private double getX() {
        double res;
        switch (model().getEventModel().eventType()) {
            case CREATE_APPLICATION:
            case CREATE_COMMAND:
            case CREATE_COMMAND_FACADE:
                res = 0;
                break;
            case CREATE_GLOBAL_FACADE:
            case CREATE_NOTIFIER:
                res = 70;
                break;
            case CREATE_SERVICE_FACADE:
            case CREATE_SERVICE:
                res = -200 * Math.cos(Math.PI / 6);
                break;
            case CREATE_UI_FACADE:
            case CREATE_MODEL:
                res = 200 * Math.cos(Math.PI / 6);
                break;

            default:
                res = 50;
        }
        return res;
    }