chord.js
function in_half_open_range(key, low, high) {
    //return (low < high && key > low && key <= high) ||
    //    (low > high && (key > low || key <= high)) ||
    //    (low == high);
    return (less_than(low, high) && less_than(low, key) && less_than_or_equal(key, high)) ||
        (less_than(high, low) && (less_than(low, key) || less_than_or_equal(key, high))) ||
        (equal_to(low, high));
}
function in_half_open_range(key, low, high) {
    //return (low < high && key > low && key <= high) ||
    //    (low > high && (key > low || key <= high)) ||
    //    (low == high);
    return (less_than(low, high) && less_than(low, key) && less_than_or_equal(key, high)) ||
        (less_than(high, low) && (less_than(low, key) || less_than_or_equal(key, high))) ||
        (equal_to(low, high));
}
function in_half_open_range ( key , low , high ) { //return (low < high && key > low && key <= high) || //    (low > high && (key > low || key <= high)) || //    (low == high); return ( less_than ( low , high ) && less_than ( low , key ) && less_than_or_equal ( key , high ) ) || ( less_than ( high , low ) && ( less_than ( low , key ) || less_than_or_equal ( key , high ) ) ) || ( equal_to ( low , high ) ) ; }
Is key in (low, high]
Is key in ( low high ]