Revision 44855 trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.expressionevaluator/org.gvsig.expressionevaluator.lib/org.gvsig.expressionevaluator.lib.impl/src/main/java/org/gvsig/expressionevaluator/impl/function/operator/DivOperator.java
DivOperator.java | ||
---|---|---|
24 | 24 |
public Object call(Interpreter interpreter, Object op1, Object op2) { |
25 | 25 |
int type = this.getType(op1, op2); |
26 | 26 |
if( (type & TYPE_DOUBLE) == TYPE_DOUBLE ) { |
27 |
double value = ((Number) op1).doubleValue() / ((Number) op2).doubleValue();
|
|
27 |
double value = getDouble(op1,1) / getDouble(op2,2);
|
|
28 | 28 |
return value; |
29 | 29 |
} |
30 | 30 |
if( (type & TYPE_FLOAT) == TYPE_FLOAT ) { |
31 |
double value = ((Number) op1).floatValue() / ((Number) op2).floatValue();
|
|
31 |
double value = getFloat(op1,1) / getFloat(op2,2);
|
|
32 | 32 |
return value; |
33 | 33 |
} |
34 | 34 |
if( (type & TYPE_LONG) == TYPE_LONG ) { |
35 |
long value = ((Number) op1).longValue() / ((Number) op2).longValue();
|
|
35 |
long value = getLong(op1,1) / getLong(op2,2);
|
|
36 | 36 |
return value; |
37 | 37 |
} |
38 | 38 |
if( (type & TYPE_INT) == TYPE_INT ) { |
39 |
int value = ((Number) op1).intValue() / ((Number) op2).intValue();
|
|
39 |
int value = getInt(op1,1) / getInt(op2,2);
|
|
40 | 40 |
return value; |
41 | 41 |
} |
42 | 42 |
throw new IllegalArgumentException("Types not allowed in '"+name()+"' operand."); |
Also available in: Unified diff