ÈçºÎÓ¦ÓÃJavaµÄBigDecimalÀà
±¾ÎĽéÉÜJavaµÄBigDecimalÀàµÄÓ¦Óá£JavaÔÚjava.math°üÖÐÌṩµÄAPIÀàBigDecimal£¬ÓÃÀ´¶Ô³¬¹ý16λÓÐЧλµÄÊý½øÐо«È·µÄÔËËã¡£
BigDecimalÀà
Ë«¾«¶È¸¡µãÐͱäÁ¿double¿ÉÒÔ´¦Àí16λÓÐЧÊý¡£ÔÚʵ¼ÊÓ¦ÓÃÖУ¬ÐèÒª¶Ô¸ü´ó»òÕ߸üСµÄÊý½øÐÐÔËËãºÍ´¦Àí¡£JavaÔÚjava.math°üÖÐÌṩµÄAPIÀàBigDecimal£¬ÓÃÀ´¶Ô³¬¹ý16λÓÐЧλµÄÊý½øÐо«È·µÄÔËËã¡£±í5.7ÖÐÁгöÁËBigDecimalÀàµÄÖ÷Òª¹¹ÔìÆ÷ºÍ·½·¨¡£
±í5.7 BigDecimalÀàµÄÖ÷Òª¹¹ÔìÆ÷ºÍ·½·¨
¹¹ÔìÆ÷ Ãè Êö
BigDecimal(int)´´½¨Ò»¸ö¾ßÓвÎÊýËùÖ¸¶¨ÕûÊýÖµµÄ¶ÔÏó¡£
BigDecimal(double)´´½¨Ò»¸ö¾ßÓвÎÊýËùÖ¸¶¨Ë«¾«¶ÈÖµµÄ¶ÔÏó¡£
BigDecimal(long)´´½¨Ò»¸ö¾ßÓвÎÊýËùÖ¸¶¨³¤ÕûÊýÖµµÄ¶ÔÏó¡£
BigDecimal(String)´´½¨Ò»¸ö¾ßÓвÎÊýËùÖ¸¶¨ÒÔ×Ö·û´®±íʾµÄÊýÖµµÄ¶ÔÏó¡£
Ðø±í
·½ ·¨Ãè Êö
add(BigDecimal)BigDecimal¶ÔÏóÖеÄÖµÏà¼Ó£¬È»ºó·µ»ØÕâ¸ö¶ÔÏó¡£
subtract(BigDecimal)BigDecimal¶ÔÏóÖеÄÖµÏà¼õ£¬È»ºó·µ»ØÕâ¸ö¶ÔÏó¡£
multiply(BigDecimal)BigDecimal¶ÔÏóÖеÄÖµÏà³Ë£¬È»ºó·µ»ØÕâ¸ö¶ÔÏó¡£
divide(BigDecimal)BigDecimal¶ÔÏóÖеÄÖµÏà³ý£¬È»ºó·µ»ØÕâ¸ö¶ÔÏó¡£
toString()½«BigDecimal¶ÔÏóµÄÊýֵת»»³É×Ö·û´®¡£
doubleValue()½«BigDecimal¶ÔÏóÖеÄÖµÒÔË«¾«¶ÈÊý·µ»Ø¡£
floatValue()½«BigDecimal¶ÔÏóÖеÄÖµÒÔµ¥¾«¶ÈÊý·µ»Ø¡£
longValue()½«BigDecimal¶ÔÏóÖеÄÖµÒÔ³¤ÕûÊý·µ»Ø¡£
intValue()½«BigDecimal¶ÔÏóÖеÄÖµÒÔÕûÊý·µ»Ø¡£
×¢Ò⣬ÓÉÓÚÒ»°ãÊýÖµÀàÐÍ£¬ÀýÈçdouble£¬²»ÄÜ׼ȷµØ´ú±í16λÓÐЧÊýÒÔÉϵÄÊý×Ö£¬ÔÚʹÓÃBigDecimalʱ£¬Ó¦ÓÃBigDecimal(String)¹¹ÔìÆ÷´´½¨¶ÔÏó²ÅÓÐÒâÒå¡£ÁíÍ⣬BigDecimalËù´´½¨µÄÊǶÔÏó£¬ÎÒÃDz»ÄÜʹÓô«Í³µÄ+¡¢-¡¢*¡¢/µÈËãÊõÔËËã·ûÖ±½Ó¶ÔÆä¶ÔÏó½øÐÐÊýѧÔËË㣬¶ø±ØÐëµ÷ÓÃÆäÏà¶ÔÓ¦µÄ·½·¨¡£·½·¨ÖеIJÎÊýÒ²±ØÐëÊÇBigDecimalµÄ¶ÔÏó¡£
¹¹ÔìÆ÷ÊÇÀàµÄÌØÊâ·½·¨£¬×¨ÃÅÓÃÀ´´´½¨¶ÔÏó£¬ÌرðÊÇ´øÓвÎÊýµÄ¶ÔÏó¡£¹ØÓÚ¹¹ÔìÆ÷¸ÅÄîºÍ±àд¼¼Êõ£¬½«ÔÚ±¾ÊéµÚ6ÕÂÏêϸ½éÉÜ¡£
ÏÂÃæÌÖÂÛBigDecimalÀàµÄһЩ³£ÓÃÀý×Ó£º
//ÍêÕû³ÌÐòÀý×ÓÔÚ±¾ÊéÅäÌ××ÊԴĿ¼Ch5ÖÐÃûΪBigDecimalTestApp.java //´´½¨BigDecimal¶ÔÏó BigDecimal bigNumber = new BigDecimal("89.1234567890123456789"); BigDecimal bigRate = new BigDecimal(1000); BigDecimal bigResult = new BigDecimal(); //¶ÔÏóbigResultµÄֵΪ0.0 
Ïà¹ØÎĵµ£º
ΪÁ˱ãÓÚ¹ÜÀí£¬ÏÈÒýÈë¸ö»ù´¡Àࣺ
package algorithms;
/**
* @author yovn
*
*/
public abstract class Sorter<E extends Comparable<E>> {
public abstract void s ......
µÚÒ»ÖÖ·½·¨Îª³£¼ûÇÒÒ×ÓÚÉÏÊÖ
1¡¢ÔÚÓ¦Óÿª·¢ÖУ¬¾³£ÐèҪһЩÖÜÆÚÐԵIJÙ×÷£¬±ÈÈçÿ5·ÖÖÓÖ´ÐÐijһ²Ù×÷
µÈ¡£¶ÔÓÚÕâÑùµÄ²Ù×÷×î·½±ã¡¢¸ßЧµÄʵÏÖ·½Ê½¾ÍÊÇʹÓÃjava.util.Timer¹¤¾ßÀà¡£
private java.util.Timer timer;
timer
= new Timer(true);
timer.schedule(
new java.util.TimerTask() {
public void run() { // ......
jarÎļþÌý˵¹ýÂð£¬Ã»ÓУ¿»òÕßİÉú£¡ºÃ£¬Ã»¹ØÏµ£¬Õâ¾ÍÊÇÎÒÃǵĵÚÒ»Õ¾£º´ò°ü·¢²¼¡£
Ϊʲô»áÓÐÕâ¸öÍæÒâÄØ£¬Ê×ÏÈ£¬ÕâÊÇjarµÄÈ«³Æ£ºJavaTM Archive (JAR) file£¬Êǵ쬾ÍÊÇjava´æµµÎļþ¡£ÕâÓеãÀàËÆzipÎļþ£¬ÏëÒ»ÏëËüÊǸÉʲôµÄÓõÄÄØ£¬Ñ¹Ëõ£¡£¿Ã»´í¾ÍÊÇҪѹËõ£¬½«ÎÒÃÇÔÏÈÁãÉ¢µÄ¶«Î÷·Åµ½Ò»Ï£¬ÖØÐÂ×éÖ¯£¬ËùÓÐÕâЩĿµÄÖ»ÓÐÒ» ......
//1.JavaÖÐ×Ö·û´®²»ÄܶàÐÐÊéд¡£¶àÐÐÊéдÓÃÒýºÅ¸ô¶Ï£¬¼ÓºÅÏàÁ¬¡£
//2.JavaµÄ±êʶ·û¿ÉÒÔÓÃÃÀÔª·ûºÅ¿ªÍ·¡£
//3.JavaÖÐûÓÐÎÞ·ûºÅ±äÁ¿»òÎÞ·ûºÅ³£Á¿µÄ¸ÅÄî¡£ËùÓеıäÁ¿¶¼ÊÇÓзûºÅµÄ¡£
//4.JavaÖбäÁ¿µÄ×Ö³¤Êǹ̶¨µÄ¡£²»´æÔÚcharºÍwcharÖ®·Ö¡£
//5.JavaÖбäÁ¿Î ......
---------------------------------------
Asp.Net,C#,SQL,JS,WCF,AJAX,¹¤×÷Á÷,WPF,MVC,LINQ,Éè¼ÆÄ£Ê½(¼Ü¹¹)µÈ¼¼ÊõÌÖÂÛ
“ASP.NET(C#)Fans” QQȺ£º96877690
---------------------------------------
²»¹ÜÊÇJ2SE¡¢J2EE»¹ÊÇJ2ME¾´Çë¼ÓÈ룡Eclipse¡¢NetBeans
Java½»Á÷QQ¸ß¼¶ÈºÀ©ÕУº96878255 ......