import java.math.BigDecimal;
public class Test {
public static void main(String[] args) {
BigDecimal bd = new BigDecimal(Math.round(0.5*1));
System.out.println(bd);
System.out.println(Math.round(0.5));
System.out.println(Math.round(0.6));
System.out.println(Math.round(0.4));
System.out.println(Math.round(1.2));
System.out.println(Math.round(1.6));
}
}
実行結果は以下のようになります。1 1 1 0 1 2