BigDecimalAttribute operands
555231
public BigDecimalAttribute plus(BigDecimalAttribute attribute)
    {
        return BigDecimalNumericType.getInstance().createCalculatedAttribute(BigDecimalNumericType.getInstance().createAdditionCalculator(this, attribute));
    }
1204032
static Object bigDecimalBinaryOperation(BigDecimal lhs, BigDecimal rhs, int kind)
        throws UtilEvalError
    {
        switch(kind)
        {
            // arithmetic
            case PLUS:
                return lhs.add(rhs);

            case MINUS:
                return lhs.subtract(rhs);

            case STAR:
                return lhs.multiply(rhs);

            case SLASH:
                return lhs.divide(rhs);

            case MOD:
            case MODX:
                return lhs.remainder(rhs);

            case POWER:
            case POWERX:
                return lhs.pow(rhs.intValue());

            // can't shift floats
            case LSHIFT:
            case LSHIFTX:
            case RSIGNEDSHIFT:
            case RSIGNEDSHIFTX:
            case RUNSIGNEDSHIFT:
            case RUNSIGNEDSHIFTX:
                throw new UtilEvalError("Can't shift floatingpoint values");

        }
        throw new InterpreterError(
                "Unimplemented binary float operator");
    }
985403
private static void setAttributes(FunctionLib extFL, FunctionLib newFL) {
	newFL.setDescription(extFL.getDescription());
	newFL.setDisplayName(extFL.getDisplayName());
	newFL.setShortName(extFL.getShortName());
	newFL.setUri(extFL.getUri());
	newFL.setVersion(extFL.getVersion());
    }
174866
function parseAttribute(attribute, defaultValue) {
    // 1em, 1.0em, 0.1em, .1em, 1.    em
    const re = /^(-{0,1}\.{0,1}\d+(\.\d+)?)[\s|\.]*(\w*)$/;
    if (attribute && re.test(attribute)) {
        const match = re.exec(attribute);
        const number = match[1];
        const units = match[3] || 'px';
        return { value: number * 1, units, original: attribute };
    }
    if (defaultValue) {
        return parseAttribute(defaultValue);
    }
    return { original: defaultValue };
}
1365695
@Override
	public void setAttribute(int semantics, int offset, int ordinate, int value) {
		setAttribute(semantics, offset, ordinate, (double) value);
	}
442177
def parseMultiAttributes(self, line):
        

        attrs = line.split(';')
        attrs = [a.strip() for a in attrs]
        attrs = filter(lambda a:len(a)>0, attrs)

        new_attrs = {}
        for a in attrs:
            k, v = a.split(':')
            k, v = [s.strip() for s in (k, v)]
            new_attrs[k] = v

        return new_attrs
630156
def _do_attr(self, n, value):
        '''''''

        W = self.write
        W(' ')
        W(n)
        W('="')
        s = string.replace(value, "&", "&amp;")
        s = string.replace(s, "<", "&lt;")
        s = string.replace(s, '"', '&quot;')
        s = string.replace(s, '\011', '&#x9')
        s = string.replace(s, '\012', '&#xA')
        s = string.replace(s, '\015', '&#xD')
        W(s)
        W('"')
1201157
function normalizeAttributes(attrs, strip) {

            // map for converting SQL types to Sequelize DataTypes.
            var map = {
                    TINYINT: 'BOOLEAN',
                    DATETIME: 'DATE',
                    TIMESTAMP: 'DATE',
                    'VARCHAR BINARY': 'STRING.BINARY',
                    'TINYBLOB': 'BLOB',
                    VARCHAR: 'STRING[LEN]',
                    'INTEGER UNSIGNED ZEORFILL': 'INTEGER[LEN].UNSIGNED.ZEROFILL',
                    'INTEGER UNSIGNED': 'INTEGER[LEN].UNSIGNED',
                    'INTEGER ZEROFILL': 'INTEGER[LEN].ZEROFILL',
                    INTEGER: 'INTEGER[LEN]',
                    'FLOAT UNSIGNED ZEORFILL': 'FLOAT[LEN].UNSIGNED.ZEROFILL',
                    'FLOAT ZEROFILL': 'FLOAT[LEN].ZEROFILL',
                    'FLOAT UNSIGNED': 'FLOAT[LEN].UNSIGNED',
                    FLOAT: 'FLOAT[LEN]',
                    'BIGINT UNSIGNED ZEORFILL': 'BIGINT[LEN].UNSIGNED.ZEROFILL',
                    'BIGINT ZEROFILL': 'BIGINT[LEN].ZEROFILL',
                    'BIGINT UNSIGNED': 'BIGINT[LEN].UNSIGNED',
                    BIGINT: 'BIGINT[LEN]',
                    DECIMAL: 'DECIMAL[LEN]',
                    ENUM: 'ENUM'
                },
                mapKeys = Object.keys(map);

            strip = strip || [];
            strip.push('Model');

            // convert and format to Sequelize Model Type.
            function getType(type, len, name) {

                if(!type) return undefined;
                type = type.split('(')[0];

                if(map[type]){
                    var tmp = map[type];
                    if(len && !_.contains([255, 11], len)) len = '(' + len + ')';
                    else len = '';
                    type = tmp.replace('[LEN]', len);
                }

                return type;
            }

            // iterate properties.
            for(var prop in attrs) {

                if(attrs.hasOwnProperty(prop)){

                    var attr = attrs[prop],
                        type = attr.type,
                        prec = type._precision && type._scale ? type._precision + ',' + type._scale : false,
                        len = prec ? prec : type._length || false;

                    // strip properties.
                    strip.forEach(function (s) {
                        if(attr[s]) delete attr[s];
                    });

                    if(attr.validate && attr.validate._checkEnum)
                        type = 'ENUM';

                    if(!type._binary && type._length)
                        type = 'VARCHAR';

                    if(type._binary)
                        type = 'VARCHAR BINARY';

                    if(_.contains(['INTEGER', 'FLOAT', 'BIGINT'], type._typeName)){
                        var tmp = '';
                        tmp = type._unsigned ? tmp += ' UNSIGNED' : tmp;
                        tmp = type._zerofill ? tmp += ' ZEROFILL' : tmp;
                        type = type._typeName + tmp;

                    }

                    if(_.isObject(type))
                        type = type._typeName;

                    attrs[prop].type = getType(type, len, attr.fieldName);

                }

            }

            return attrs;
        }
10515
def norm_attr(self):
        
        if not self.HAS_ATTR:
            return

        self.HAS_ATTR = False
        self.emit('call', 'COPY_ATTR', 0)
        backend.REQUIRES.add('copy_attr.asm')
1094224
def getattribute(value, arg):
    """"""

    if hasattr(value, str(arg)):
        return getattr(value, arg)
    elif hasattr(value, 'has_key') and value.has_key(arg):
        return value[arg]
    elif numeric_test.match(str(arg)) and len(value) > int(arg):
        return value[int(arg)]
    else:
        return settings.TEMPLATE_STRING_IF_INVALID
82822
function parseRangeRetrievalSpecifierAttribute(attribute) {
  var re = new RegExp(pattern, 'i');
  var match = re.exec(attribute);
  return({
    attributeName: match[1],
    low: parseInt(match[2]),
    high: parseInt(match[3]) || null
  });
}
392503
public Item withNumber(String attrName, BigDecimal val) {
        checkInvalidAttribute(attrName, val);
        attributes.put(attrName, val);
        return this;
    }
1316864
public static BigDecimal round(String numberStr, int scale, RoundingMode roundingMode) {
		Assert.notBlank(numberStr);
		if (scale < 0) {
			scale = 0;
		}
		return round(toBigDecimal(numberStr), scale, roundingMode);
	}
1069563
public static BigDecimal abs(EvaluationContext ctx, Object number) {
        return Conversions.toDecimal(number, ctx).abs();
    }
734197
def p_ExtendedAttributeNoArgs(p):
  """"""
  p[0] = model.ExtendedAttribute(
    value=model.ExtendedAttributeValue(name=p[1]))
81117
private void appendAttribute(Appendable buf, String attrName, String encodedValue) throws IOException {
        buf.append(' ').append(attrName).append('=').append('\"').append(encodedValue).append('\"');
    }
60622
@SuppressWarnings("unchecked")
    public <T> T getAttribute( String attrName, Class<T> adaptee ) {
        if (attrName == null) {
            return null;
        }
        if (adaptee == null) {
            adaptee = (Class<T>) String.class;
        }

        Object attribute = feature.getAttribute(attrName);
        if (attribute == null) {
            return null;
        }
        if (attribute instanceof Number) {
            Number num = (Number) attribute;
            if (adaptee.isAssignableFrom(Double.class)) {
                return adaptee.cast(num.doubleValue());
            } else if (adaptee.isAssignableFrom(Float.class)) {
                return adaptee.cast(num.floatValue());
            } else if (adaptee.isAssignableFrom(Integer.class)) {
                return adaptee.cast(num.intValue());
            } else if (adaptee.isAssignableFrom(Long.class)) {
                return adaptee.cast(num.longValue());
            } else if (adaptee.isAssignableFrom(String.class)) {
                return adaptee.cast(num.toString());
            } else {
                throw new IllegalArgumentException();
            }
        } else if (attribute instanceof String) {
            if (adaptee.isAssignableFrom(Double.class)) {
                try {
                    Double parsed = Double.parseDouble((String) attribute);
                    return adaptee.cast(parsed);
                } catch (Exception e) {
                    return null;
                }
            } else if (adaptee.isAssignableFrom(Float.class)) {
                try {
                    Float parsed = Float.parseFloat((String) attribute);
                    return adaptee.cast(parsed);
                } catch (Exception e) {
                    return null;
                }
            } else if (adaptee.isAssignableFrom(Integer.class)) {
                try {
                    Integer parsed = Integer.parseInt((String) attribute);
                    return adaptee.cast(parsed);
                } catch (Exception e) {
                    return null;
                }
            } else if (adaptee.isAssignableFrom(String.class)) {
                return adaptee.cast(attribute);
            } else {
                throw new IllegalArgumentException();
            }
        } else if (attribute instanceof Geometry) {
            return null;
        } else {
            throw new IllegalArgumentException("Can't adapt attribute of type: " + attribute.getClass().getCanonicalName());
        }
    }