Code example for BigDecimal

Methods: equals

0
	private static class Divide implements NumericFunction { 
 
		public BigDecimal apply(BigDecimal... args) {
			if ( args.length != 2 )
				return null; 
			if ( args[1].equals( BigDecimal.ZERO ) )
				return null; 
		 
			BigDecimal result = args[0].divide( args[1], MathContext.DECIMAL128 );
			 
			return result;
		} 
 
		public BigDecimal apply(BigInteger... args) {
			if ( args.length != 2 )
				return null; 
			if ( args[1].equals( BigInteger.ZERO ) )
				return null; 
		 
			BigDecimal first = new BigDecimal( args[0] );
			BigDecimal second = new BigDecimal( args[1] );