131 |
|
|
132 |
double val2 = Double.parseDouble( mEdit.getText().toString() ); |
double val2 = Double.parseDouble( mEdit.getText().toString() ); |
133 |
|
|
134 |
Double res = 0.0; |
double res = 0.0; |
135 |
switch (mOperation) { |
switch (mOperation) { |
136 |
case Addition: |
case Addition: |
137 |
res = mVal1 + val2; |
res = mVal1 + val2; |
147 |
break; |
break; |
148 |
} |
} |
149 |
|
|
150 |
if ( res.isInfinite() || res.isNaN() ) { |
if ( Double.isInfinite(res) || Double.isNaN(res) ) { |
151 |
mClear = true; |
mClear = true; |
152 |
} |
} |
153 |
|
|
154 |
mEdit.setText( res.toString() ); |
|
155 |
|
mEdit.setText( Double.toString(res) ); |
156 |
mOperation = Ops.None; |
mOperation = Ops.None; |
157 |
mVal1 = res; |
mVal1 = res; |
158 |
} |
} |