Check if input equals zero within given tolerance
3142
function iszero(x, tolerance) {
    if (tolerance === void 0) { tolerance = constants_1.EPSILON; }
    // the 'less-than-equal' comparision is necessary for correct result
    // when tolerance = 0
    return Math.abs(x) <= tolerance;
}
1067075
function thresholdToZero (m, TOL) {
  const me = m.elements;
  for (let i = 0; i < 9; ++i) {
    if (Compare.isZero(me[i], TOL)) {
      me[i] = 0;
    }
  }
  return m;
}
238745
def _check_L(self, L):
        """"""
        # TODO: Take this out?
        if issparse(L):
            L = L.todense()

        # Check for correct values, e.g. warning if in {-1,0,1}
        if np.any(L < 0):
            raise ValueError("L must have values in {0,1,...,k}.")
446714
def allZero(buffer):
    
    allZero = True
    for byte in buffer:
        if byte != "\x00":
            allZero = False
            break
    return allZero
268547
function checkDimension(i) {
  const ln = checkNumber(i);
  let li;

  if (i >= tokensLength ||
      !ln ||
      i + ln >= tokensLength) return 0;

  return (li = checkUnit(i + ln)) ? ln + li : 0;
}
1183983
def _trim_zeros_float(str_floats, na_rep='NaN'):
    
    trimmed = str_floats

    def _is_number(x):
        return (x != na_rep and not x.endswith('inf'))

    def _cond(values):
        finite = [x for x in values if _is_number(x)]
        return (len(finite) > 0 and all(x.endswith('0') for x in finite) and
                not (any(('e' in x) or ('E' in x) for x in finite)))

    while _cond(trimmed):
        trimmed = [x[:-1] if _is_number(x) else x for x in trimmed]

    # leave one 0 after the decimal points if need be.
    return [x + "0" if x.endswith('.') and _is_number(x) else x
            for x in trimmed]
606817
public static ZMatrixRMaj checkZerosLT(ZMatrixRMaj A , int numRows , int numCols) {
        if( A == null ) {
            return new ZMatrixRMaj(numRows,numCols);
        } else if( numRows != A.numRows || numCols != A.numCols )
            throw new IllegalArgumentException("Input is not "+numRows+" x "+numCols+" matrix");
        else {
            for( int i = 0; i < A.numRows; i++ ) {
                int index = i*A.numCols*2;
                int end = index + Math.min(i,A.numCols)*2;;
                while( index < end ) {
                    A.data[index++] = 0;
                }
            }
        }
        return A;
    }
37962
function check_value(val, min, max) {
    val = +val;
    if (typeof(val) != 'number' || val < min || val > max || Math.floor(val) !== val) {
        throw new TypeError("\"value\" argument is out of bounds");
    }
    return val;
}
853976
private void checkForLeadingZeroes() {
    Character la1 = chars.lookahead(1);
    Character la2 = chars.lookahead(2);
    if (la1 != null && la1 == '0' && CharType.DIGIT.isMatchedBy(la2)) {
      throw new ParseException("Numeric identifier MUST NOT contain leading zeroes");
    }
  }
536413
def _check_inputs(z, m):
    """"""
    try:
        nz = len(z)
        z = np.array(z)
    except TypeError:
        z = np.array([z])
        nz = len(z)
    try:
        nm = len(m)
        m = np.array(m)
    except TypeError:
        m = np.array([m])
        nm = len(m)

    if (z < 0).any() or (m < 0).any():
        raise ValueError('z and m must be positive')

    if nz != nm and nz > 1 and nm > 1:
        raise ValueError('z and m arrays must be either equal in length, \
                          OR of different length with one of length 1.')

    else:
        if type(z) != np.ndarray:
            z = np.array(z)
        if type(m) != np.ndarray:
            m = np.array(m)

        return z, m
185099
public static void notZero(final Integer input, final String inputName) {
        notNull(input, inputName);

        if (input == 0) {
            throw new IllegalArgumentException("a zero value for was unexpected for " + maskNullArgument(inputName) + ", it is expected to be non zero");
        }
    }
119775
def validate_timeout_or_zero(option, value):
    
    if value is None:
        raise ConfigurationError("%s cannot be None" % (option, ))
    if value == 0 or value == "0":
        return 0
    return validate_positive_float(option, value) / 1000.0
470259
function zeropad(input, length) {
      input = input + ''; // Ensure input is a string.
      length = length || 2; // Ensure a length is set.
      return input.length >= length ? input : new Array(length - input.length + 1).join('0') + input;
    }
47666
def check_array(array):
    ""

    if len(array) < 1:
        raise ValueError('Input array is empty! Must have atleast 1 element.')

    return np.ma.masked_invalid(array).flatten()
488097
function( tolerance ){
            //if tolerance is 0, it will be faster to just use 'equals' method
            var equals = tolerance ? 'equalsWithTolerance' : 'equals';
            var p, prev, i = 0, num = this.vertices.length;
            var last;
            for( ; i<num; i++ ){
                p = this.vertices[i];
                //if its the 'equals' method tolerance will just be ingored
                if( p[equals]( prev, tolerance ) ){
                    //remove from array, step back counter
                    this.vertices.splice( i, 1 );
                    i--;
                    num--;
                } else {
                    prev = p;
                }
            }
            num = this.vertices.length;
            if( num >  0 ){
                last = this.vertices[num-1];
                if( last[equals]( this.vertices[0], tolerance ) ){
                    this.vertices.splice( num-1, 1 );
                }
            }
            return this;
        }
318450
def _range_check(self, value, min_value, max_value):
        '''
        
        '''
        if value < min_value or value > max_value:
            raise ValueError('%s out of range - %s is not between %s and %s' % (self.__class__.__name__, value, min_value, max_value))
229816
function isIgnore (ignore, str) {
  let result = false
  let i = 0
  while (!result && i < ignore.length) {
    if (ignore[i] === str) {
      result = true
    }

    i++
  }
  return result
}