Code example for BigDecimal

Methods: multiply

0
    	int i = mStack.size() - 1;
		mMode = Mode.OP;
		if( i > 0 ) {
	    	BigDecimal a = mStack.remove(i);
	    	BigDecimal b = mStack.remove(i-1);
	    	mStack.add(a.multiply(b));
	    	mAdapter.notifyDataSetChanged();
        	mStackView.smoothScrollToPosition(mStack.size() -1);
		} 
    } 
     
    public void sign(View v) {
    	// always change the sign of the bottom item on the stack 
    	if( mMode == Mode.INPUT ) {
    		int i = mInput.indexOf("-");
    		// if there isn't a negative sign, add one. else, remove it 
    		if(-1 == i) {
        		// prepend a negative sign 
    			mInput.insert(0, '-');
    		} else { 
    			// delete the negative sign