|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
ÀÌÀü Ŭ·¡½º Â÷ÀÇ Å¬·¡½º | ÇÁ·¹ÀÓÀ¸·Î ÇÁ·¹ÀÓ ¾øÀÌ | |||||||||
°³¿ä: NESTED | Çʵå | constructor | ¸Þ¼µå | »ó¼¼: Çʵå | »ý¼ºÀÚ | ¸Þ¼µå |
java.lang.Objectjava.math.MathContext
public final class MathContext
BigDecimal
Ŭ·¡½º¿¡ ±¸ÇöµÇ°í ÀÖ´Â °Í °°Àº ¼öÄ¡ ¿¬»êÀÚÀÇ ±ÔÄ¢¿¡ ´ëÇØ ¼³¸íÇÏ´Â ÄÁÅØ½ºÆ®
¼³Á¤À» ĸ½¶ÈÇÏ´Â ºÒº¯ÀÇ °´Ã¼ÀÔ´Ï´Ù.
º£À̽º¿¡ Á¸ÇÏÁö ¾Ê´Â ¼³Á¤À¸·Î¼ ´ÙÀ½ÀÇ °ÍÀÌ ÀÖ½À´Ï´Ù.
RoundingMode
°´Ã¼. µÕ±Ù 󸮸¦ À§ÇÑ ¾Ë°í¸®ÁòÀ» ÁöÁ¤ÇÑ´Ù
BigDecimal
,
RoundingMode
,
Á÷·ÄÈ µÈ Çü½Ä ÇÊµå °³¿ä | |
---|---|
static MathContext |
DECIMAL128
IEEE 754R Decimal28 Çü½Ä, 34 ÀÚ¸®¼ö, µÕ±Ù ¸ðµå´Â IEEE 754R µðÆúÆ®ÀÎ HALF_EVEN
Á¤¹Ðµµ°¡ ¼³Á¤µÈ MathContext °´Ã¼ÀÔ´Ï´Ù. |
static MathContext |
DECIMAL32
IEEE 754R Decimal32 Çü½Ä, 7 ÀÚ¸®¼ö, µÕ±Ù ¸ðµå´Â IEEE 754R µðÆúÆ®ÀÎ HALF_EVEN
Á¤¹Ðµµ°¡ ¼³Á¤µÈ MathContext °´Ã¼ÀÔ´Ï´Ù. |
static MathContext |
DECIMAL64
IEEE 754R Decimal64 Çü½Ä, 16 ÀÚ¸®¼ö, µÕ±Ù ¸ðµå´Â IEEE 754R µðÆúÆ®ÀÎ HALF_EVEN
Á¤¹Ðµµ°¡ ¼³Á¤µÈ MathContext °´Ã¼ÀÔ´Ï´Ù. |
static MathContext |
UNLIMITED
¹«Á¦ÇÑÀÇ Á¤¹Ðµµ¿¡¼ÀÇ °è»ê¿¡ ÇÊ¿äÇÑ °ªÀÌ ¼³Á¤µÇ¾î ÀÖ´Â MathContext °´Ã¼ÀÔ´Ï´Ù. |
»ý¼ºÀÚ °³¿ä | |
---|---|
MathContext (int setPrecision)
ÁöÁ¤ÀÇ Á¤¹Ðµµ¿Í µÕ±Ù ¸ðµå HALF_UP
»õ·Î¿î MathContext¸¦ ±¸ÃàÇÕ´Ï´Ù. |
|
MathContext (int setPrecision,
RoundingMode setRoundingMode)
ÁöÁ¤ÀÇ Á¤¹Ðµµ¿Í µÕ±Ù ¸ðµåÀÇ »õ·Î¿î MathContext¸¦ ±¸ÃàÇÕ´Ï´Ù. |
|
MathContext (String val)
ij¸¯ÅÍ ¶óÀÎÀ¸·ÎºÎÅÍ »õ·Î¿î MathContext¸¦ ±¸ÃàÇÕ´Ï´Ù. |
¸Þ¼µå °³¿ä | |
---|---|
boolean |
equals (Object x)
ÀÌ MathContext¿Í ÁöÁ¤µÈ Object°¡ µ¿ÀÏÇÑÁö ¾î¶²Áö¸¦ ºñ±³ÇÕ´Ï´Ù. |
int |
getPrecision ()
precision ¼³Á¤À» ¸®ÅÏÇÕ´Ï´Ù. |
RoundingMode |
getRoundingMode ()
roundingMode ¼³Á¤À» ¸®ÅÏÇÕ´Ï´Ù. |
int |
hashCode ()
ÀÌ MathContext ÇØ½Ã Äڵ带 ¸®ÅÏÇÕ´Ï´Ù. |
String |
toString ()
ÀÌ MathContext ij¸¯ÅÍ ¶óÀΠǥÇöÀ» ¸®ÅÏÇÕ´Ï´Ù. |
Ŭ·¡½º java.lang. Object ·ÎºÎÅÍ »ó¼ÓµÈ ¸Þ¼µå |
---|
clone,
finalize,
getClass,
notify,
notifyAll,
wait,
wait,
wait |
ÇʵåÀÇ »ó¼¼ |
---|
public static final MathContext UNLIMITED
precision=0 roundingMode=HALF_UP
ÀÔ´Ï´Ù.
public static final MathContext DECIMAL32
HALF_EVEN
Á¤¹Ðµµ°¡ ¼³Á¤µÈ MathContext °´Ã¼ÀÔ´Ï´Ù.
public static final MathContext DECIMAL64
HALF_EVEN
Á¤¹Ðµµ°¡ ¼³Á¤µÈ MathContext °´Ã¼ÀÔ´Ï´Ù.
public static final MathContext DECIMAL128
HALF_EVEN
Á¤¹Ðµµ°¡ ¼³Á¤µÈ MathContext °´Ã¼ÀÔ´Ï´Ù.
»ý¼ºÀÚ »ó¼¼ |
---|
public MathContext(int setPrecision)
HALF_UP
»õ·Î¿î MathContext¸¦ ±¸ÃàÇÕ´Ï´Ù.
setPrecision
- ºÎÀÇ ¼ö ÀÌ¿ÜÀÇ int Á¤¹Ðµµ ¼³Á¤
IllegalArgumentException
- Á¦·Î ¹Ì¸¸ÀÇ setPrecision ÆÄ¶ó¹ÌÅÍpublic MathContext(int setPrecision, RoundingMode setRoundingMode)
setPrecision
- ºÎÀÇ ¼ö ÀÌ¿ÜÀÇ int Á¤¹Ðµµ ¼³Á¤setRoundingMode
- »ç¿ëÇÏ´Â µÕ±Ù ¸ðµå
IllegalArgumentException
- Á¦·Î ¹Ì¸¸ÀÇ setPrecision ÆÄ¶ó¹ÌÅÍpublic MathContext(String val)
toString()
¸Þ¼µå¿¡ ÀÇÇØ »ý¼ºµÈ Çü½ÄÀÌ ¾Æ´Ï¸é ¾ÈµË´Ï´Ù.
ij¸¯ÅÍ ¶óÀÎÀÇ Á¤¹Ðµµ ºÎºÐÀÌ ¹üÀ§¿Ü (0 ¹Ì¸¸)ÀÇ °æ¿ì, ¶Ç´Â toString()
¸Þ¼µå¿¡ ÀÇÇØ »ý¼ºµÈ Çü½ÄÀÇ Ä³¸¯ÅÍ ¶óÀÎÀÌ ¾Æ´Ñ °æ¿ì, IllegalArgumentExceptionÀÌ
¹ß»ý µË´Ï´Ù.
val
- ÇØ¼®µÇ´Â ij¸¯ÅÍ ¶óÀÎ
IllegalArgumentException
- Á¤¹Ðµµ ÆÄ¶ó¹ÌÅͰ¡ ¹üÀ§¿ÜÀÇ °æ¿ì, ¶Ç´Â Çü½ÄÀÌ ºÎÁ¤ÇÑ °æ¿ì¸Þ¼µåÀÇ »ó¼¼ |
---|
public int getPrecision()
public RoundingMode getRoundingMode()
RoundingMode.CEILING
,
RoundingMode.DOWN
,
RoundingMode.FLOOR
,
RoundingMode.HALF_DOWN
,
RoundingMode.HALF_EVEN
,
RoundingMode.HALF_UP
,
RoundingMode.UNNECESSARY
,
RoundingMode.UP
¾î´À ÂÊÀΰ¡¿¡ µË´Ï´Ù.
public boolean equals(Object x)
Object
³»ÀÇ equals
x
- ÀÌ MathContext¿Í
ºñ±³ÇÏ´Â Object
Object.hashCode()
,
Hashtable
public int hashCode()
Object
³»ÀÇ hashCode
Object.equals(java.lang.Object)
,
Hashtable
public String toString()
Integer.toString
¸Þ¼µå¿¡ ÀÇÇØ »ý¼ºµÈ °Í °°Àº ¼öÄ¡ ij¸¯ÅÍ ¶óÀÎÀÌ °è¼ÓµÈ´Ù
RoundingMode
¿°ÅÇü³»ÀÇ ´ëÀÀÇÏ´Â public Á¤¼öÀÇ À̸§°ú ÀÏÄ¡ÇÑ´Ù´ÙÀ½¿¡ ¿¹¸¦ ³ªÅ¸³À´Ï´Ù.
precision=9 roundingMode=HALF_UPÀå·¡, ÀÌ Å¬·¡½º¿¡ ÇÁ·ÎÆÛƼ°¡ Ãß°¡µÇ´Â ÀÏÀÌ ÀÖ¾úÀ» °æ¿ì, toString °á°ú¿¡ ´Ü¾î¸¦ Ãß°¡ÇÒ ¼ö ÀÖ½À´Ï´Ù .
Object
³»ÀÇ toString
|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
ÀÌÀü Ŭ·¡½º Â÷ÀÇ Å¬·¡½º | ÇÁ·¹ÀÓÀ¸·Î ÇÁ·¹ÀÓ ¾øÀÌ | |||||||||
°³¿ä: NESTED | Çʵå | constructor | ¸Þ¼µå | »ó¼¼: Çʵå | »ý¼ºÀÚ | ¸Þ¼µå |
Copyright 2004 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms . Documentation Redistribution Policy µµ ÂüÁ¶ÇϽʽÿÀ.