11.11 Binary Logical Operators
500149
function parseLogicalANDExpression() {
        var expr = parseBitwiseORExpression();

        while (match('&&')) {
            lex();
            expr = {
                type: Syntax.LogicalExpression,
                operator: '&&',
                left: expr,
                right: parseBitwiseORExpression()
            };
        }

        return expr;
    }
958232
def Compile(self, filter_implemention):
    """"""
    operator = self.operator.lower()
    if operator == "and" or operator == "&&":
      method = "AndFilter"
    elif operator == "or" or operator == "||":
      method = "OrFilter"
    else:
      raise ParseError("Invalid binary operator %s" % operator)

    args = [x.Compile(filter_implemention) for x in self.args]
    return filter_implemention.FILTERS[method](arguments=args)
1361193
function binop() {
		var left = primary();

		var m = str.match(/^ *(OR|AND) */i);
		if (!m) return left;

		str = str.slice(m[0].length);

		var right = binop();

		return {
			type: 'op',
			op: m[1].toLowerCase(),
			left: left,
			right: right
		}
	}
990647
function (operator, left, right) {
			var type = (operator === '||' || operator === '&&') ? LOGICAL_EXP : BINARY_EXP;
			return {
				type: type,
				operator: operator,
				left: left,
				right: right
			};
		}
474318
function binaryString( x ) {
	var nbits;
	var sign;
	var str;
	var exp;
	var n;
	var f;
	var i;

	// Check for a negative value or negative zero...
	if ( x < 0 || 1/x === ninf ) {
		sign = '1';
	} else {
		sign = '0';
	}
	// Special case: +-infinity
	if ( x === pinf || x === ninf ) {
		// Based on IEEE 754-2008...
		exp = repeat( '1', 8 ); // all 1s
		str = repeat( '0', 23 ); // all 0s
		return sign + exp + str;
	}
	// Special case: NaN
	if ( x !== x ) {
		// Based on IEEE 754-2008...
		exp = repeat( '1', 8 ); // all 1s
		str = '1' + repeat( '0', 22 ); // can't be all 0s
		return sign + exp + str;
	}
	// Special case: +-0
	if ( x === 0 ) {
		// Based on IEEE 754-2008...
		exp = repeat( '0', 8 ); // all 0s
		str = repeat( '0', 23 ); // all 0s
		return sign + exp + str;
	}
	x = abs( x );

	// Isolate the integer part (digits before the decimal):
	n = floor( x );

	// Isolate the fractional part (digits after the decimal):
	f = x - n;

	// Convert the integer and fractional parts to bit strings:
	n = div2( n );
	f = mult2( f );

	// Determine the exponent needed to normalize the integer+fractional parts...
	if ( n ) {
		// Move the decimal `d` digits to the left:
		exp = n.length - 1;
	} else {
		// Find the first '1' bit...
		for ( i = 0; i < f.length; i++ ) {
			if ( f[ i ] === '1' ) {
				nbits = i + 1;
				break;
			}
		}
		// Move the decimal `d` digits to the right:
		exp = -nbits;
	}
	// Normalize the combined integer+fractional string...
	str = n + f;
	if ( exp < 0 ) {
		// Handle subnormals...
		if ( exp <= -BIAS ) {
			// Cap the number of bits removed:
			nbits = BIAS - 1;
		}
		// Remove all leading zeros and the first '1' for normal values, and, for subnormals, remove at most BIAS-1 leading bits:
		str = str.substring( nbits );
	} else {
		// Remove the leading '1' (implicit/hidden bit):
		str = str.substring( 1 );
	}
	// Convert the exponent to a bit string:
	exp = div2( exp + BIAS );
	exp = lpad( exp, 8, '0' );

	// Fill in any trailing zeros and ensure we have only 23 fraction bits:
	str = rpad( str, 23, '0' ).substring( 0, 23 );

	// Return a bit representation:
	return sign + exp + str;
}
331702
function parseEqualityExpression() {
        var expr = parseRelationalExpression();

        while (match('==') || match('!=') || match('===') || match('!==')) {
            expr = {
                type: Syntax.BinaryExpression,
                operator: lex().value,
                left: expr,
                right: parseRelationalExpression()
            };
        }

        return expr;
    }
439145
def binary_operation_logical(self, rule, left, right, **kwargs):
        
        return LogicalBinOpRule(rule.operation, left, right)
991645
def _get_boolean(data, position, dummy0, dummy1):
    """"""
    end = position + 1
    return data[position:end] == b"\x01", end
1035761
def _add_logical_operator(self, operator):
        

        if not self.c_oper:
            raise QueryExpressionError("Logical operators must be preceded by an expression")

        self.current_field = None
        self.c_oper = None

        self.l_oper = inspect.currentframe().f_back.f_code.co_name
        self._query.append(operator)
        return self
316726
function parse_operator_type(op, def) {
	op = ''+op;
	if(op.indexOf(':') === -1) {
		return def || 'boolean';
	}
	return op.split(':')[1];
}
1259986
def _bin_op(name, doc="binary operator"):
    
    def _(self, other):
        jc = other._jc if isinstance(other, Column) else other
        njc = getattr(self._jc, name)(jc)
        return Column(njc)
    _.__doc__ = doc
    return _
995332
function checkForDisallowedESSymbolOperand(operator) {
                var offendingSymbolOperand = maybeTypeOfKind(leftType, 512 /* ESSymbol */) ? left :
                    maybeTypeOfKind(rightType, 512 /* ESSymbol */) ? right :
                        undefined;
                if (offendingSymbolOperand) {
                    error(offendingSymbolOperand, ts.Diagnostics.The_0_operator_cannot_be_applied_to_type_symbol, ts.tokenToString(operator));
                    return false;
                }
                return true;
            }
735807
static Object longBinaryOperation(long lhs, long rhs, int kind)
    {
        switch(kind)
        {
            // arithmetic
            case PLUS:
                if ( lhs > 0 && (Long.MAX_VALUE - lhs) < rhs )
                    break;
                return lhs + rhs;

            case MINUS:
                if ( lhs < 0 && (Long.MIN_VALUE - lhs) > -rhs )
                    break;
                return lhs - rhs;

            case STAR:
                if ( lhs != 0 && Long.MAX_VALUE / lhs < rhs )
                    break;
                return lhs * rhs;

            case SLASH:
                return lhs / rhs;

            case MOD:
            case MODX:
                return lhs % rhs;

            case POWER:
            case POWERX:
                double check = Math.pow(lhs, rhs);
                BigInteger bi = BigDecimal.valueOf(check).toBigInteger();
                if ( bi.compareTo(Primitive.LONG_MIN) >= 0 && bi.compareTo(Primitive.LONG_MAX) <= 0 )
                    return (long) check;
                break;

            // bitwise
            case LSHIFT:
            case LSHIFTX:
                return lhs << rhs;

            case RSIGNEDSHIFT:
            case RSIGNEDSHIFTX:
                return lhs >> rhs;

            case RUNSIGNEDSHIFT:
            case RUNSIGNEDSHIFTX:
                return lhs >>> rhs;

            case BIT_AND:
            case BIT_ANDX:
                return lhs & rhs;

            case BIT_OR:
            case BIT_ORX:
                return lhs | rhs;

            case XOR:
            case XORX:
                return lhs ^ rhs;

        }
        if ( OVERFLOW_OPS.contains(kind) )
            return bigIntegerBinaryOperation(BigInteger.valueOf(lhs), BigInteger.valueOf(rhs), kind);

        throw new InterpreterError(
                "Unimplemented binary long operator");
    }
500123
function isBinary(buffer) {
  var chunk = buffer.toString('utf8', 0, Math.min(buffer.length, 24));
  for (var i in chunk) {
    var charCode = chunk.charCodeAt(i);
    if (charCode == 65533 || charCode <= 8) {
      return true;
    }
  }
  return false;
}
988399
public static int binaryLCA(int x, int y) {
		if (x == y) {
			return x;
		}
		int xor = x ^ y;
		int idx = getMaxExp(xor);
		if (idx == -1) {
			throw new UnsupportedOperationException();
		}
		return replaceBy1and0sFrom(x, idx);
	}
977527
def logical_or(self, other):
        """"""
        return self.operation(other, lambda x, y: int(x or y))
489676
def boolean_operator_query(boolean_operator):
    """"""
    def _boolean_operator_query(expressions):
        """Apply boolean operator to expressions."""
        def _apply_boolean_operator(query_function, expressions=expressions):
            """Return if expressions with boolean operator are satisfied."""
            compiled_expressions = [compile_query(e) for e in expressions]
            return reduce(
                boolean_operator,
                [e(query_function) for e in compiled_expressions]
            )

        return _apply_boolean_operator
    return _boolean_operator_query