BigDecimal b2=new BigDecimal(Double.toString(v2));
return b1.divide(b2, scale,BigDecimal.ROUND_HALF_UP).doubleval_rue();
}
public static double round(double v,int scale){
if(scale<0){
throw new IllegalArgumentException(
"The scale must be a positive integer or zero");
}
BigDecimal b=new BigDecimal(Double.toString(v));
BigDecimal one=new BigDecimal(1);
return b.divide(one,scale,BigDecimal.ROUND_HALF_UP).doubleval_rue();
}
public static void main(String [] args){
Arith arith=new Arith();
System.out.println(arith.div(13,3));
}
}