ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] HALF_DOWN©MHALF_UPªº®t§O?

[µo°Ý] HALF_DOWN©MHALF_UPªº®t§O?

µ{¦¡½X¦p¤U:
package _03.bigdecimal;
import java.math.BigDecimal;
import java.math.RoundingMode;
public class BigDecimalDemo {
        public static void main(String[] args) {
                BigDecimal bd2=BigDecimal.valueOf(11);
                BigDecimal bd3=new BigDecimal("2.3");
                BigDecimal bdDiv = bd2.divide(bd3,38,RoundingMode.HALF_UP);
                System.out.println(bdDiv);
                BigDecimal bdDivDOWN = bd2.divide(bd3,10, RoundingMode.HALF_DOWN);
                System.out.println(bdDivDOWN);               
                BigDecimal bdDivUP = bd2.divide(bd3,10, RoundingMode.HALF_UP);
                System.out.println(bdDivUP);
        }
}

½sĶµ²ªG¦p¤U:
4.78260869565217391304347826086956521739
4.7826086957
4.7826086957

½Ð°ÝbdDivDOWN ¬°¤°»ò©MbdDivUP ªºµª®×¬Û¦P?
JACK

        ÀR«ä¦Û¦b : ¡i¥Í©R¦b©I§l¶¡¡j¦òªû»¡¡G¡u¥Í©R¦b©I§l¶¡¡C¡v¤HµLªkºÞ¦í¦Û¤vªº¥Í©R¡A§óµLªk¾×¦í¦º´Á¡AÅý¦Û¤v¥Ã¦í¤H¶¡¡C¬JµM¥Í©R¥h¨Ó³o»òµL±`¡A§Ú­Ì§óÀ³¸Ó¦n¦n¦a·R±¤¥¦¡B§Q¥Î¥¦¡B¥R¹ê¥¦¡AÅý³oµL±`¡BÄ_¶Qªº¥Í©R¡A´²µo¥¦¯uµ½¬üªº¥ú½÷¡A¬M·Ó¥X¥Í©R¯u¥¿ªº»ù­È¡C
ªð¦^¦Cªí ¤W¤@¥DÃD