BigDecimal
ããã¨ã©ãã§ãè¯ãæ´å²ã®æéã§ãã ã¾ãã¯æµ®åå°æ°ç¹ã®è¦æ ¼ã«ã¤ãã¦ãµãã¦ãããã IEEE754-1985 = 2é²æµ®åå°æ°ç¹æ° IEEE854-1987 = åºæ°ã«ä¾åããªãæµ®åå°æ°ç¹æ°ã®è¦æ ¼ï¼ã¨ã¯è¨ã£ã¦ãã»ã»ã»ï¼ IEEE754-2008 = IEEE754-1985 + IEEE854-1987 = 主ã«10é²æµ®â¦
é¢åèããã¨ã調ã¹ããã¨ã«ãªã£ãJavaããã°ã©ãã¼ã«æ§ã ãããæéãå²ãã¦æ大æ¡æ°ãè¨ç®ãã¦ã¿ããã¨ã«ãã¾ããã çµè«ãããã㨠2793926648æ¡ãããã ã¨æãã 精度ã®éçã¯646443000æ¡ãããã§ãã ç¡é大æ°ã128æ¡ã§ããã¨è£è¶³ãã¦ãããã åããâ¦
以åæ¸ããã¡ã¢çãªã¨ã³ããªã¼ãèªã¿è¿ãã¦ã¿ã¦ã ç°¡åãªã¨ã³ããªã¼ã«æ¸ããªãããã¨æããã£ãã java.math.BigDecimalã®æ§é ã精度(precision)ãã¨ãã¹ã±ã¼ã«(scale)ãã¨ãä¸è¬çãªæ¡æ°ãã®éã 精度ã¨ã¹ã±ã¼ã«ã®éããæ£ããææ¡ãã¦ãããã試ãã®ã«ã â¦
ãªããªã34æ¡ç®ã¾ã§åããã¨ããã®ã¯è¦å´ãä¼´ãã ã¨ããããMathContextã«69æ¡ãããè¨å®ãããããªãã¨ãè¨ç®åºæ¥ãã£ã½ãã å¹³æ¹æ ¹ã®è¨ç®ã§æ¤ç®ããªãããã£ã¦ã¿ãã 9.99999999999999999999999999999999999997E6144ã®å¹³æ¹æ ¹ã®é£æ度ãé«ãã æ¤ç®(2ä¹)ãâ¦
expé¢æ°ãåºæ¥ãããlogné¢æ°ãåºæ¥ãã®ã§ãpoweré¢æ°ãåºæ¥ãã æ§è½ããªããªãè¯ãããã¾ããã®4ããªç§å°ãåºã¦ããã doubleãªã50ããç§ãããã ãããã©ã public static BigDecimal power(BigDecimal x, BigDecimal y){ return exp(y.multiply(logn(x)â¦
æ¨æ¥ã²ããããã¼ã javaã§ã¤ãã«ä½ããã¼ã ãã£ãã極ãã¦ããã ã¾ãWikipediaã«ãããã¢ã«ã´ãªãºã ã§nãæ´æ°ã®nä¹æ ¹ãå®è£ ããã ããã§ãå°æ°ã®1/nä¹ï¼å°æ°ã®nä¹æ ¹)ããåºæ¥ãã ãããã¹ã¿ã¼ãã©ã¤ã³ã Xã®Yä¹ã«ãããYã1/nã¨èããã®ãä¸è¨ã®nä¹æ ¹ã â¦
以åã®æ¥è¨ãããä¸åº¦æ¸ãã¦ãããããªãããªãã ãâ¦ã å ã«ä»å æ å ±ãæ¸ãã¦ããã -XX:AutoBoxCacheMax=ã¨ããVMãªãã·ã§ã³ãå¹ãããã ã ãã¶ããããJava6.0 update 14ãããªãã ãããã ç§ã確èªããç°å¢ã¯update 17ã§ãã ãããä»ãã¦ããªã¼ããã¯â¦
2012/11/4è¿½è¨ ãã£ã¡è¦ã¦ããã£ãæ¹ãããããã Javaããã°ã©ãã¼ã®ããã®java.math.BigDecimalã¾ã¨ã - ãã©ããã®ããã° 2012/11/4è¿½è¨ çµãã ãã£ããã¨ç¾ åãã¦ã¿ãã java.math.BigDecimalã¯ãã¯ã©ã¹èª¬æã«ããéãä»»æ精度ã®ã¹ã±ã¼ã«ãªãæ´æ°ã¨ã32â¦
æè¦ãåã¿åããªãã åã¯ãã£ã¨æ£ããã¯ãã ã 1d/3dãå®ç§ãªå¤ãä¿æãã¦ãã¨å¯è¨ãè¨ã人ã«è² ãããªèªåã å°æ°ç¹æ¼ç®ã«ããã¦ã1÷3ã¯ç¡çæ°ã§ããã ç¡çæ°ãæéæ°ã®bitã§è¡¨ç¾ããè¡ã¯ãªãã æ ã«1d/3dã¯ä¸¸ã¾ã£ã¦ããã ã¡ãªã¿ã«ã1dã¯æçæ°ã3dãæâ¦
家ã®Sun JDKã¯1.6.0_06ã¨çµæ§å¤ãã§ãã æ¨å¹´7æã®å¼è¶ããããããåç·å¼ãã¦ãªãã®ã§ããããæ´æ°ããã¦ã¾ããã java.sql.ResultSetã®ã½ã¼ã¹ãè¦ã¦ãããã BigDecimal getBigDecimal(int columnIndex,int scale) throws SQLException ã®JavaDocã«èª¤è¨ãâ¦
è·å ´ã§ä½¿ã£ã¦ãRAD7.5.2ã§ä½¿ã£ã¦ãjava -versionã ....\IBM\SDP\jdk\bin>java.exe -version - java version "1.6.0" Java(TM) SE Runtime Environment (build pwi3260sr4-20090219_01(SR4)) IBM J9 VM (build 2.4, J2RE 1.6.0 IBM J9 2.4 Windows XP x86-32â¦