import java.math.BigDecimal;

public class Prog1 
{//examples of using divide and add in  BigDecimal arithmetic
	public static void main(String[] asd)
	{			
		BigDecimal one = new  BigDecimal("1.0");
		//the parameter, here "1.0" is either a string
		BigDecimal three = new  BigDecimal(3);//or a double or int
		BigDecimal ans1 =one.divide(three, 25, BigDecimal.ROUND_HALF_UP);
		System.out.println("result is " + ans1);
		
		BigDecimal ans2 =one.divide(three, 25, BigDecimal.ROUND_UP);
		System.out.println("result is " + ans2);
		
		BigDecimal ans3 =one.divide(three, 25, BigDecimal.ROUND_DOWN);
		System.out.println("result is " + ans3);
		
		BigDecimal sum = new BigDecimal(0);
		for(int j = 0; j < 3; j++)
		{
			sum = sum.add(ans1);
		}
		System.out.println("the sum is " +sum);
	} 	
}
				
				
