Lines Matching refs:operand

13  * returning an object with 'accumulator', 'operator', and 'operand' properties
24 // For operations, ignore the last operator if no operand was entered,
26 // operator. In either case, clear the operand and the defaults.
27 var operator = this.operand && this.operator;
28 var result = this.calculate_(operator, this.operand);
34 // clear the operator and operand and return a transient state with a '='
37 var operand = this.operator ? this.operand : this.defaults.operand;
38 var result = this.calculate_(operator, operand);
39 var defaults = {operator: operator, operand: this.operand};
44 return this.operand ? this.set_({operand: null}) :
48 var length = (this.operand || '').length;
49 return (length > 1) ? this.set_({operand: this.operand.slice(0, -1)}) :
50 this.operand ? this.set_({operand: null}) :
53 var initial = (this.operand || '0')[0];
54 return (initial === '-') ? this.set_({operand: this.operand.slice(1)}) :
55 (initial !== '0') ? this.set_({operand: '-' + this.operand}) :
58 var operand = (this.operand || '0') + input;
59 var duplicate = (operand.replace(/[^.]/g, '').length > 1);
60 var overflow = (operand.replace(/[^0-9]/g, '').length > this.precision);
61 return operand.match(/^0[0-9]/) ? this.set_({operand: operand[1]}) :
62 (!duplicate && !overflow) ? this.set_({operand: operand}) :
73 this.accumulator = this.operand = this.operator = null;
74 this.defaults = {operator: null, operand: null};
89 this.operand = ifDefined(state && state.operand, this.operand);
95 * Performs a calculation based on the passed in operator and operand, updating
96 * the model's state with the operator and operand used but returning the result
101 Model.prototype.calculate_ = function(operator, operand) {
103 var y = operand ? Number(operand) : x;
104 this.set_({accumulator: String(x), operator: operator, operand: String(y)});