소스 검색

add is_within

master
Jonathan Cobb 3 년 전
부모
커밋
7ff35206d5
1개의 변경된 파일5개의 추가작업 그리고 0개의 파일을 삭제
  1. +5
    -0
      src/main/resources/org/cobbzilla/util/javascript/standard_js_lib.js

+ 5
- 0
src/main/resources/org/cobbzilla/util/javascript/standard_js_lib.js 파일 보기

@@ -174,3 +174,8 @@ function pct_diff (x, y) {
function is_close_enough (x, y, max_pct) {
return 100 - pct_diff(x, y) <= ((typeof max_pct == "undefined") ? 1.0 : max_pct);
}

// return true if x is "within" max_delta of y
function is_within (x, y, max_delta) {
return Math.abs(x - y) < max_delta;
}

불러오는 중...
취소
저장