BigDecimal加减乘除运算(转)

时间:2021-08-14 23:10:17

java.math.BigDecimal。BigDecimal一共有4个够造方法,让我先来看看其中的两种用法:

第一种:BigDecimal(double val)
Translates a double into a BigDecimal.

第二种:BigDecimal(String val)
Translates the String repre sentation of a BigDecimal into a BigDecimal.

使用BigDecimal要用String来够造,要做一个加法运算,需要先将两个浮点数转为String,然后够造成BigDecimal,在其中一个上调用add方法,传入另一个作为参数,然后把运算的结果(BigDecimal)再转换为浮点数。

public static double add(double v1,double v2)
public static double sub(double v1,double v2)
public static double mul(double v1,double v2)
public static double div(double v1,double v2)
public static double div(double v1,double v2,int scale)
public static double round(double v,int scale)

import java.math.BigDecimal;
/**
* 由于Java的简单类型不能够精确的对浮点数进行运算,这个工具类提供精
* 确的浮点数运算,包括加减乘除和四舍五入。
*/
public class Arith{ //默认除法运算精度
private static final int DEF_DIV_SCALE = 10; //这个类不能实例化
private Arith(){
}
/**
* 提供精确的加法运算。
* @param v1 被加数
* @param v2 加数
* @return 两个参数的和
*/
public static double add(double v1,double v2){
BigDecimal b1 = new BigDecimal(Double.toString(v1));
BigDecimal b2 = new BigDecimal(Double.toString(v2));
return b1.add(b2).doubleValue();
}
/**
* 提供精确的减法运算。
* @param v1 被减数
* @param v2 减数
* @return 两个参数的差
*/
public static double sub(double v1,double v2){
BigDecimal b1 = new BigDecimal(Double.toString(v1));
BigDecimal b2 = new BigDecimal(Double.toString(v2));
return b1.subtract(b2).doubleValue();
}
/**
* 提供精确的乘法运算。
* @param v1 被乘数
* @param v2 乘数
* @return 两个参数的积
*/
public static double mul(double v1,double v2){
BigDecimal b1 = new BigDecimal(Double.toString(v1));
BigDecimal b2 = new BigDecimal(Double.toString(v2));
return b1.multiply(b2).doubleValue();
}
/**
* 提供(相对)精确的除法运算,当发生除不尽的情况时,精确到
* 小数点以后10位,以后的数字四舍五入。
* @param v1 被除数
* @param v2 除数
* @return 两个参数的商
*/
public static double div(double v1,double v2){
return div(v1,v2,DEF_DIV_SCALE);
}
/**
* 提供(相对)精确的除法运算。当发生除不尽的情况时,由scale参数指
* 定精度,以后的数字四舍五入。
* @param v1 被除数
* @param v2 除数
* @param scale 表示表示需要精确到小数点以后几位。
* @return 两个参数的商
*/
public static double div(double v1,double v2,int scale){
if(scale<0){
throw new IllegalArgumentException(
"The scale must be a positive integer or zero");
}
BigDecimal b1 = new BigDecimal(Double.toString(v1));
BigDecimal b2 = new BigDecimal(Double.toString(v2));
return b1.divide(b2,scale,BigDecimal.ROUND_HALF_UP).doubleValue();
}
/**
* 提供精确的小数位四舍五入处理。
* @param v 需要四舍五入的数字
* @param scale 小数点后保留几位
* @return 四舍五入后的结果
*/
public static double round(double v,int scale){
if(scale<0){
throw new IllegalArgumentException("The scale must be a positive integer or zero");
}
BigDecimal b = new BigDecimal(Double.toString(v));
BigDecimal one = new BigDecimal("1");
return b.divide(one,scale,BigDecimal.ROUND_HALF_UP).doubleValue();
}
};
 
&nbsp;
<p>java.math.BigDecimal。BigDecimal一共有4个够造方法,让我先来看看其中的两种用法:</p>
<p>第一种:BigDecimal(double val)<br>
Translates a double into a BigDecimal. </p>
<p>第二种:BigDecimal(String val)<br>
Translates the String repre sentation of a BigDecimal into a BigDecimal. </p>
<p>使用BigDecimal要用String来够造,要做一个加法运算,需要先将两个浮点数转为String,然后够造成BigDecimal,在其中一个上调用add方法,传入另一个作为参数,然后把运算的结果(BigDecimal)再转换为浮点数。</p>
<p><br>
public static double add(double v1,double v2)<br>
public static double sub(double v1,double v2)<br>
public static double mul(double v1,double v2)<br>
public static double div(double v1,double v2)<br>
public static double div(double v1,double v2,int scale)<br>
public static double round(double v,int scale)</p>
<p>&nbsp;</p>
<div class="">
dp-highlighter<div class="">
bar<div class="">Java代码 <toolsa title="" 复制代码href="">
http://callan.iteye.com/blog/200526#<img alt="" 复制代码src=""></http://callan.iteye.com/images/icon_copy.gifa>&nbsp;<a title="" 收藏这段代码href=""><img class="" staralt="" 收藏代码src=""><http://callan.iteye.com/images/icon_star.pngimg class="" spinnersrc="" http://callan.iteye.com/images/spinner.gifalt="" style=""></a></div>
</div>
<ol class="">
dp-j<li><span><span class="">import</keywordspan><span>&nbsp;java.math.BigDecimal; &nbsp;&nbsp;</span></span></li><li><span></span><span class="">/** </commentspan>&nbsp;</li><li><span><span class="">*comment&nbsp;由于Java的简单类型不能够精确的对浮点数进行运算,这个工具类提供精 </span>&nbsp;</span></li><li><span><span class="">*comment&nbsp;确的浮点数运算,包括加减乘除和四舍五入。 </span>&nbsp;</span></li><li><span><span class="">*/</commentspan><span>&nbsp;&nbsp;</span></span></li><li><span></span><span class="">public</keywordspan><span>&nbsp;</span><span class="">class</keywordspan><span>&nbsp;Arith{&nbsp;</span><span class="">//默认除法运算精度
comment</span><span>&nbsp;&nbsp;</span></li><li><span></span><span class="">private</keywordspan><span>&nbsp;</span><span class="">static</keywordspan><span>&nbsp;</span><span class="">final</keywordspan><span>&nbsp;</span><span class="">int</keywordspan><span>&nbsp;DEF_DIV_SCALE&nbsp;=&nbsp;</span><span class="">10</numberspan><span>;&nbsp;</span><span class="">//这个类不能实例化
comment</span><span>&nbsp;&nbsp;</span></li><li><span></span><span class="">private</keywordspan><span>&nbsp;Arith(){ &nbsp;&nbsp;</span></li><li><span>} &nbsp;&nbsp;</span></li><li><span></span><span class="">/** </commentspan>&nbsp;</li><li><span><span class="">*comment&nbsp;提供精确的加法运算。 </span>&nbsp;</span></li><li><span><span class="">*comment&nbsp;@param&nbsp;v1&nbsp;被加数 </span>&nbsp;</span></li><li><span><span class="">*comment&nbsp;@param&nbsp;v2&nbsp;加数 </span>&nbsp;</span></li><li><span><span class="">*comment&nbsp;@return&nbsp;两个参数的和 </span>&nbsp;</span></li><li><span><span class="">*/</commentspan><span>&nbsp;&nbsp;</span></span></li><li><span></span><span class="">public</keywordspan><span>&nbsp;</span><span class="">static</keywordspan><span>&nbsp;</span><span class="">double</keywordspan><span>&nbsp;add(</span><span class="">double</keywordspan><span>&nbsp;v1,</span><span class="">double</keywordspan><span>&nbsp;v2){
&nbsp;&nbsp;</span></li><li><span>BigDecimal&nbsp;b1&nbsp;=&nbsp;</span><span class="">new</keywordspan><span>&nbsp;BigDecimal(Double.toString(v1)); &nbsp;&nbsp;</span></li><li><span>BigDecimal&nbsp;b2&nbsp;=&nbsp;</span><span class="">new</keywordspan><span>&nbsp;BigDecimal(Double.toString(v2)); &nbsp;&nbsp;</span></li><li><span></span><span class="">return</keywordspan><span>&nbsp;b1.add(b2).doubleValue(); &nbsp;&nbsp;</span></li><li><span>} &nbsp;&nbsp;</span></li><li><span></span><span class="">/** </commentspan>&nbsp;</li><li><span><span class="">*comment&nbsp;提供精确的减法运算。 </span>&nbsp;</span></li><li><span><span class="">*comment&nbsp;@param&nbsp;v1&nbsp;被减数 </span>&nbsp;</span></li><li><span><span class="">*comment&nbsp;@param&nbsp;v2&nbsp;减数 </span>&nbsp;</span></li><li><span><span class="">*comment&nbsp;@return&nbsp;两个参数的差 </span>&nbsp;</span></li><li><span><span class="">*/</commentspan><span>&nbsp;&nbsp;</span></span></li><li><span></span><span class="">public</keywordspan><span>&nbsp;</span><span class="">static</keywordspan><span>&nbsp;</span><span class="">double</keywordspan><span>&nbsp;sub(</span><span class="">double</keywordspan><span>&nbsp;v1,</span><span class="">double</keywordspan><span>&nbsp;v2){
&nbsp;&nbsp;</span></li><li><span>BigDecimal&nbsp;b1&nbsp;=&nbsp;</span><span class="">new</keywordspan><span>&nbsp;BigDecimal(Double.toString(v1)); &nbsp;&nbsp;</span></li><li><span>BigDecimal&nbsp;b2&nbsp;=&nbsp;</span><span class="">new</keywordspan><span>&nbsp;BigDecimal(Double.toString(v2)); &nbsp;&nbsp;</span></li><li><span></span><span class="">return</keywordspan><span>&nbsp;b1.subtract(b2).doubleValue(); &nbsp;&nbsp;</span></li><li><span>} &nbsp;&nbsp;</span></li><li><span></span><span class="">/** </commentspan>&nbsp;</li><li><span><span class="">*comment&nbsp;提供精确的乘法运算。 </span>&nbsp;</span></li><li><span><span class="">*comment&nbsp;@param&nbsp;v1&nbsp;被乘数 </span>&nbsp;</span></li><li><span><span class="">*comment&nbsp;@param&nbsp;v2&nbsp;乘数 </span>&nbsp;</span></li><li><span><span class="">*comment&nbsp;@return&nbsp;两个参数的积 </span>&nbsp;</span></li><li><span><span class="">*/</commentspan><span>&nbsp;&nbsp;</span></span></li><li><span></span><span class="">public</keywordspan><span>&nbsp;</span><span class="">static</keywordspan><span>&nbsp;</span><span class="">double</keywordspan><span>&nbsp;mul(</span><span class="">double</keywordspan><span>&nbsp;v1,</span><span class="">double</keywordspan><span>&nbsp;v2){
&nbsp;&nbsp;</span></li><li><span>BigDecimal&nbsp;b1&nbsp;=&nbsp;</span><span class="">new</keywordspan><span>&nbsp;BigDecimal(Double.toString(v1)); &nbsp;&nbsp;</span></li><li><span>BigDecimal&nbsp;b2&nbsp;=&nbsp;</span><span class="">new</keywordspan><span>&nbsp;BigDecimal(Double.toString(v2)); &nbsp;&nbsp;</span></li><li><span></span><span class="">return</keywordspan><span>&nbsp;b1.multiply(b2).doubleValue(); &nbsp;&nbsp;</span></li><li><span>} &nbsp;&nbsp;</span></li><li><span></span><span class="">/** </commentspan>&nbsp;</li><li><span><span class="">*comment&nbsp;提供(相对)精确的除法运算,当发生除不尽的情况时,精确到 </span>&nbsp;</span></li><li><span><span class="">*comment&nbsp;小数点以后10位,以后的数字四舍五入。 </span>&nbsp;</span></li><li><span><span class="">*comment&nbsp;@param&nbsp;v1&nbsp;被除数 </span>&nbsp;</span></li><li><span><span class="">*comment&nbsp;@param&nbsp;v2&nbsp;除数 </span>&nbsp;</span></li><li><span><span class="">*comment&nbsp;@return&nbsp;两个参数的商 </span>&nbsp;</span></li><li><span><span class="">*/</commentspan><span>&nbsp;&nbsp;</span></span></li><li><span></span><span class="">public</keywordspan><span>&nbsp;</span><span class="">static</keywordspan><span>&nbsp;</span><span class="">double</keywordspan><span>&nbsp;div(</span><span class="">double</keywordspan><span>&nbsp;v1,</span><span class="">double</keywordspan><span>&nbsp;v2){
&nbsp;&nbsp;</span></li><li><span></span><span class="">return</keywordspan><span>&nbsp;div(v1,v2,DEF_DIV_SCALE); &nbsp;&nbsp;</span></li><li><span>} &nbsp;&nbsp;</span></li><li><span></span><span class="">/** </commentspan>&nbsp;</li><li><span><span class="">*comment&nbsp;提供(相对)精确的除法运算。当发生除不尽的情况时,由scale参数指 </span>&nbsp;</span></li><li><span><span class="">*comment&nbsp;定精度,以后的数字四舍五入。 </span>&nbsp;</span></li><li><span><span class="">*comment&nbsp;@param&nbsp;v1&nbsp;被除数 </span>&nbsp;</span></li><li><span><span class="">*comment&nbsp;@param&nbsp;v2&nbsp;除数 </span>&nbsp;</span></li><li><span><span class="">*comment&nbsp;@param&nbsp;scale&nbsp;表示表示需要精确到小数点以后几位。 </span>&nbsp;</span></li><li><span><span class="">*comment&nbsp;@return&nbsp;两个参数的商 </span>&nbsp;</span></li><li><span><span class="">*/</commentspan><span>&nbsp;&nbsp;</span></span></li><li><span></span><span class="">public</keywordspan><span>&nbsp;</span><span class="">static</keywordspan><span>&nbsp;</span><span class="">double</keywordspan><span>&nbsp;div(</span><span class="">double</keywordspan><span>&nbsp;v1,</span><span class="">double</keywordspan><span>&nbsp;v2,</span><span class="">int</keywordspan><span>&nbsp;scale){
&nbsp;&nbsp;</span></li><li><span></span><span class="">if</keywordspan><span>(scale&lt;</span><span class="">0</numberspan><span>){ &nbsp;&nbsp;</span></li><li><span></span><span class="">throw</keywordspan><span>&nbsp;</span><span class="">new</keywordspan><span>&nbsp;IllegalArgumentException( &nbsp;&nbsp;</span></li><li><span></span><span class="">string&quot;The&nbsp;scale&nbsp;must&nbsp;be&nbsp;a&nbsp;positive&nbsp;integer&nbsp;or&nbsp;zero&quot;</span><span>); &nbsp;&nbsp;</span></li><li><span>} &nbsp;&nbsp;</span></li><li><span>BigDecimal&nbsp;b1&nbsp;=&nbsp;</span><span class="">new</keywordspan><span>&nbsp;BigDecimal(Double.toString(v1)); &nbsp;&nbsp;</span></li><li><span>BigDecimal&nbsp;b2&nbsp;=&nbsp;</span><span class="">new</keywordspan><span>&nbsp;BigDecimal(Double.toString(v2)); &nbsp;&nbsp;</span></li><li><span></span><span class="">return</keywordspan><span>&nbsp;b1.divide(b2,scale,BigDecimal.ROUND_HALF_UP).doubleValue(); &nbsp;&nbsp;</span></li><li><span>} &nbsp;&nbsp;</span></li><li><span></span><span class="">/** </commentspan>&nbsp;</li><li><span><span class="">*comment&nbsp;提供精确的小数位四舍五入处理。 </span>&nbsp;</span></li><li><span><span class="">*comment&nbsp;@param&nbsp;v&nbsp;需要四舍五入的数字 </span>&nbsp;</span></li><li><span><span class="">*comment&nbsp;@param&nbsp;scale&nbsp;小数点后保留几位 </span>&nbsp;</span></li><li><span><span class="">*comment&nbsp;@return&nbsp;四舍五入后的结果 </span>&nbsp;</span></li><li><span><span class="">*/</commentspan><span>&nbsp;&nbsp;</span></span></li><li><span></span><span class="">public</keywordspan><span>&nbsp;</span><span class="">static</keywordspan><span>&nbsp;</span><span class="">double</keywordspan><span>&nbsp;round(</span><span class="">double</keywordspan><span>&nbsp;v,</span><span class="">int</keywordspan><span>&nbsp;scale){
&nbsp;&nbsp;</span></li><li><span></span><span class="">if</keywordspan><span>(scale&lt;</span><span class="">0</numberspan><span>){ &nbsp;&nbsp;</span></li><li><span></span><span class="">throw</keywordspan><span>&nbsp;</span><span class="">new</keywordspan><span>&nbsp;IllegalArgumentException(</span><span class="">string&quot;The&nbsp;scale&nbsp;must&nbsp;be&nbsp;a&nbsp;positive&nbsp;integer&nbsp;or&nbsp;zero&quot;</span><span>); &nbsp;&nbsp;</span></li><li><span>} &nbsp;&nbsp;</span></li><li><span>BigDecimal&nbsp;b&nbsp;=&nbsp;</span><span class="">new</keywordspan><span>&nbsp;BigDecimal(Double.toString(v)); &nbsp;&nbsp;</span></li><li><span>BigDecimal&nbsp;one&nbsp;=&nbsp;</span><span class="">new</keywordspan><span>&nbsp;BigDecimal(</span><span class="">string&quot;1&quot;</span><span>); &nbsp;&nbsp;</span></li><li><span></span><span class="">return</keywordspan><span>&nbsp;b.divide(one,scale,BigDecimal.ROUND_HALF_UP).doubleValue(); &nbsp;&nbsp;</span></li><li><span>} &nbsp;&nbsp;</span></li><li><span>};&nbsp;&nbsp;</span></li></ol>
</div>
<link rel="" stylesheethref="" />
http://static.blog.csdn.net/public/res-min/markdown_views.css?v=1.0 </div>
</dd>
</dl>
</div>
<div class="">
skin_nav <div class=""><skin_editi class=""></fa fa-th-listi>
<div class=""><nav_list nav_list_edita href="">文章列表<//huiwenjie168a></div>
</div> </div>
<div class="">
rssFix <a href="" http://blog.csdn.net/huiwenjie168/rss/listclass="" columnonclick=""><_gaq.push(['_trackEvent','function', 'onclick', 'blog_articles_RSS'])i class=""></fa fa-rssi></a>
</div> <div id="" goTopBtnclass=""><skin_backTopi class=""></fa fa-chevron-upi></div>
</div>
<div class="">
detail_b <p class="" reprint_copystyle="" display:noneid=""></copyrightp>
<!--
<div class="bole" style="display:none">
<h2 class="bole_t clearfix"><span>伯乐推荐</span>
<label>一共有<em>{bolecount}</em>位博乐进行推荐</label>
</h2>
{bolecomment}
</div>
-->
<!-- style=""style=""-->
<h2 class="" >
praise <label id="" diggArticleId="" 6998140onclick="" ><btndigga();span id="">顶</btnDiggspan><em>14</em></label>
<label id="" buryonclick=""><btnburya();span id="" >踩</btnBuryspan><em>0</em></label>
</h2>
<div class="" tracking-addata-mod=""><popu_222a href="" >javascript:void(0);&nbsp;</a> </div>
<div class="" tracking-addata-mod=""> <popu_223a href="" >javascript:void(0);&nbsp;</a></div> <script type="">
text/javascript function btndigga() {
$(".tracking-ad[data-mod='popu_222'] a").click();
}
function btnburya() {
$(".tracking-ad[data-mod='popu_223'] a").click();
} $(function () {
if ($(".markdown_views").length > 0) {
if($("#fromjs").length==0)
{
$('pre.prettyprint code').each(function () {
var lines = $(this).text().split('\n').length;
var $numbering = $('<ul/>').addClass('pre-numbering').hide();
$(this).addClass('has-numbering').parent().append($numbering);
for (i = 1; i <= lines; i++) {
$numbering.append($('<li/>').text(i));
};
$numbering.fadeIn(1700);
});
}
}
else {
$("#article_content pre").each(function () {
var $this = $(this);
if ($this.attr("class") != undefined) {
if ($this.attr("class").indexOf("brush:") != -1) {
var lang = $this.attr("class").split(';')[0].split(':')[1];
$this.attr('name', 'code');
$this.attr('class', lang);
}
if ($this.attr("class")) {
$this.attr('name', 'code');
}
}
});
$('#article_content textarea[name=code]').each(function () {
var $this = $(this);
if ($this.attr("class").indexOf(":") != -1) {
$this.attr("class", $this.attr("class").split(':')[0]);
}
});
dp.SyntaxHighlighter.HighlightAll('code');
$('.highlighter').addClass('dp-highlighter');
if (!window.clipboardData) {
setTimeout("setCopyBtn()", 500);
} function __get_code_toolbar(snippet_id) {
return $("<span class='tracking-ad' data-mod='popu_167'><a href='https://code.csdn.net/snippets/"
+ snippet_id
+ "' target='_blank' title='在CODE上查看代码片' style='text-indent:0;'><img src='https://code.csdn.net/assets/CODE_ico.png' width=12 height=12 alt='在CODE上查看代码片' style='position:relative;top:1px;left:2px;'/></a></span>"
+ "<span class='tracking-ad' data-mod='popu_170'><a href='https://code.csdn.net/snippets/"
+ snippet_id
+ "/fork' target='_blank' title='派生到我的代码片' style='text-indent:0;'><img src='https://code.csdn.net/assets/ico_fork.svg' width=12 height=12 alt='派生到我的代码片' style='position:relative;top:2px;left:2px;'/></a></span>");
} $("[code_snippet_id]").each(function () {
__s_id = $(this).attr("code_snippet_id");
if (__s_id != null && __s_id != "" && __s_id != 0 && parseInt(__s_id) > 70020) {
__code_tool = __get_code_toolbar(__s_id);
$(this).prev().find(".tools").append(__code_tool);
}
}); $(".bar").show();
}
});
</script>
<div class="">
blog_share <!--<i class="fa fa-qq"></i><i class="fa fa-weixin"></i><i class="fa fa-weibo"></i><i class="fa fa-renren"></i><i class="fa fa-qq"></i><i class="fa fa-weixin"></i>
<i class="fa fa-weibo"></i><i class="fa fa-renren"></i>-->
<div class="" bdsharebuttonbox tracking-adstyle="" float: right;data-mod="">
popu_172 <a href="" #class="" bds_moredata-cmd="" morestyle=""></background-position:0 0 !important; background-image: url(http://bdimg.share.baidu.com/static/api/img/share/icons_0_16.png?v=d754dcc0.png) !importanta>
<a href="" #class="" bds_qzonedata-cmd="" qzonetitle="" 分享到QQ空间style=""></background-position:0 -52px !importanta>
<a href="" #class="" bds_tsinadata-cmd="" tsinatitle=""分享到新浪微博style=""></background-position:0 -104px !importanta>
<a href="" #class="" bds_tqqdata-cmd="" tqqtitle=""分享到腾讯微博style=""></background-position:0 -260px !importanta>
<a href="" #class="" bds_renrendata-cmd="" renrentitle=""分享到人人网style=""></background-position:0 -208px !importanta>
<a href="" #class="" bds_weixindata-cmd="" weixintitle=""分享到微信style="" ></background-position:0 -1612px !importanta>
</div>
<script>window._bd_share_config = { "common": { "bdSnsKey": {}, "bdText": "", "bdMini": "1", "bdMiniList": false, "bdPic": "", "bdStyle": "0", "bdSize": "16" }, "share": {} }; with (document) 0[(getElementsByTagName('head')[0] || body).appendChild(createElement('script')).src = 'http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion=' + ~(-new Date() / 36e5)];</script>
<!-- Baidu Button END -->
</div>
<div class="">
forward_back <div class=""><back fla href="" javascript:void(0);onclick=""><_gaq.push(['_trackEvent','function', 'onclick', 'blog_articles_shangyipian']);location.href='http://blog.csdn.net/huiwenjie168/article/details/6997817';span><i class=""></fa fa-arrow-lefti></span><em>关于Ireport的使用技巧</em></a></div><div class=""><forward fra href="" javascript:void(0);onclick=""><_gaq.push(['_trackEvent','function', 'onclick', 'blog_articles_xiayipian']);location.href='http://blog.csdn.net/huiwenjie168/article/details/7007357';em>如何使用Log4j</em><span><i class=""></fa fa-arrow-righti></span></a></div>
</div>
<div>
<script type="">
text/javascript /*博客内容页下方Banner2-728*90,创建于2014-7-3*/
var cpro_id = "u1607657";
</script>
<script type="" text/javascriptsrc=""></http://cpro.baidustatic.com/cpro/ui/c.jsscript>
</div>
<!--
{articleinsamecategory}
-->
<div class="" commentid="">
comment_form <div id="">
commentsbmitarear <h2 class="">发表评论</comment_th2>
<dl class="" publish_comment clearfixid="">
commentbox <dt><a href=""><http://my.csdn.net/img src=""></a></dt>
<dd>
<form action="" /huiwenjie168/comment/submit?id=6998140method="" postonsubmit="" return subform(this);id="">
commentform <textarea class="" publish_txtid=""></comment_contenttextarea>
<div class="">
publish clearfix
<div class=""><publish_li class=""></fa fa-code J_codei></div> <input type="" hiddenid="" comment_replyIdname="">
comment_replyId <input type="" hiddenid="" comment_userIdname="" comment_userIdvalue="">
<input type="" hiddenid="" commentIdname="" commentIdvalue=""> <a href="" javascript:void(0);class=""> 发表评论</publish_btna>&nbsp;&nbsp;<span id="" tip_commentstyle=""></color: Red; display: none;span> <div class="" comment-code-pop J_lang_listid="" lang_listcode=""><codea href="" #htmlstyle="" width:95px;class="">HTML/XML</long_namea><a href="" #objcstyle="" width:95px;class="">objective-c</long_namea><a href="" #delphistyle="" width:58px;class="">Delphi</zhong_namea><a href="" #rubyclass="">Ruby</zhong_namea><a href="">PHP</#phpa><a href="" #csharpclass="">C#</duan_namea><a style="" border-right: none;href="" #cppclass="">C++</duan_namea><a style="" border-bottom:none;width:95px;href="" #javascriptclass="">JavaScript</long_namea><a style="" border-bottom:none;width:95px;href="" #vbclass="">Visual Basic</long_namea><a style="" border-bottom:none;href="" #pythonclass="">Python</zhong_namea><a style="" border-bottom:none;href="" #javaclass="">Java</zhong_namea><a style="" border-bottom:none;href="" #cssclass="">CSS</duan_namea><a style="" border-bottom:none;href="" #sqlclass="">SQL</duan_namea><a style="" border:none;href="" #plainclass="">其它</duan_namea><span class=""></arrbspan></div>
</div>
</form>
</dd>
</dl>
</div>
<a name=""></commentsa>
<div class="" comment_listid=""></comment_listdiv>
<div style="">height:60px&nbsp;</div>
</div>
</div>
</div>
</div>
<div class="">
skin_right <div id="" skin_r_wrapclass="">
skin_r_wrap <div id="" skin_rclass=""><skin_ri id="" arrow_rclass=""></fa fa-arrow-righti>
<div class=""><messa href=""><http://my.csdn.net/huiwenjie168img src="" http://avatar.csdn.net/3/A/4/1_huiwenjie168.jpgalt="" imgclass=""></heada>
<p class="">huiwenjie168</mess_namep>
<div class="">
grade <p><span>等级:</span><img src=""></http://c.csdnimg.cn/jifen/images/xunzhang/jianzhang/blog5.pngp>
<p><span>排名:</span><span>第10068名</span></p>
</div>
<div class=""><blog_medala href=""></http://blog.csdn.net/experts/rule.htmla>
<div class=""></medal_cdiv>
<div class="">
attention <a href="" javascript:void(0);id=""><span_add_followi class=""></fa fa-plusi><span>加关注</span></a>
<a href="" javascript:void(0);onClick=""><window.open('http://msg.csdn.net/letters/model?receiver=huiwenjie168','_blank','height=350,width=700');_gaq.push(['_trackEvent','function', 'onclick', 'blog_articles_sixin'])i class=""></fa fa-envelope-oi><span>发私信</span></a>
</div>
<div class=""></contactdiv>
</div>
</div>
<div class="">
classify <!--
<dl class="classify_list js_list">
<dt>
<div class="js_column"><i class="fa fa-th"></i><a href="#" class="column">文章分类</a></div>
</dt>
</dl> <dl class="classify_list">
<dt><i class="fa fa-play-circle"></i><a href="/huiwenjie168/blog/course" class="column">我的课程</a></dt>
</dl>
--> <dl class="">
classify_list <div class="">
article_search <div class="">
article_search_c <form id="" frmSearchaction="" http://so.csdn.net/searchclass="" form_search csdn-tracking-statisticstarget="" _blankdata-mod="">
popu_306 <input type="" textid="" inputSearchplaceholder=""><文章搜索i class="" fa fa-searchid=""></btnSubmiti>
</form>
</div>
</div>
</dl>
<script type="">
text/javascript $(function () {
$("#btnSubmit").unbind("click");
$("#btnSubmit").click(function () {
search();
}); $("#frmSearch").submit(function () {
search();
return false;
}); function search()
{
if ($("#inputSearch").val() == "") {
alert("请录入搜索关键词!");
return false;
}
//var url = "http://so.csdn.net/so/search/s.do?q=" + encodeURIComponent($("#inputSearch").val()) + "&u=" + username + "&t=blog";
var url = "https://www.baidu.com/s?wd=" + encodeURIComponent($("#inputSearch").val()) + "%20site%3Ablog.csdn.net"
window.location.href = url;
}
});
</script> <dl class="">
classify_list <dt><i class=""></fa fa-file-texti><a href="" /huiwenjie168/blog/columnclass="">博客专栏</columna> </dt>
</dl> <dl class="">
classify_list js_list <dt>
<div class=""><js_column_wrapi class=""></fa fa-thi><span class="">文章分类</columnspan></div>
<ul id="" article_list0class="">
article_list <li><a href="" /huiwenjie168/article/category/2539973onclick="">java</_gaq.push(['_trackEvent','function', 'onclick', 'blog_articles_wenzhangfenlei']);a><span>(23)</span></li><li><a href="" /huiwenjie168/article/category/3103225onclick="">数据库</_gaq.push(['_trackEvent','function', 'onclick', 'blog_articles_wenzhangfenlei']);a><span>(4)</span></li><li><a href="" /huiwenjie168/article/category/3103229onclick="">javaScript</_gaq.push(['_trackEvent','function', 'onclick', 'blog_articles_wenzhangfenlei']);a><span>(5)</span></li><li><a href="" /huiwenjie168/article/category/3103255onclick="">jsp</_gaq.push(['_trackEvent','function', 'onclick', 'blog_articles_wenzhangfenlei']);a><span>(2)</span></li><li><a href="" /huiwenjie168/article/category/3103269onclick="">SSH</_gaq.push(['_trackEvent','function', 'onclick', 'blog_articles_wenzhangfenlei']);a><span>(7)</span></li><li><a href="" /huiwenjie168/article/category/3103273onclick="">其他</_gaq.push(['_trackEvent','function', 'onclick', 'blog_articles_wenzhangfenlei']);a><span>(10)</span></li><li><a href="" /huiwenjie168/article/category/3103293onclick="">Tomcat</_gaq.push(['_trackEvent','function', 'onclick', 'blog_articles_wenzhangfenlei']);a><span>(4)</span></li><li><a href="" /huiwenjie168/article/category/3103305onclick="">JQuery</_gaq.push(['_trackEvent','function', 'onclick', 'blog_articles_wenzhangfenlei']);a><span>(2)</span></li>
</ul>
</dt>
<dd style=""><display:nonea href="" #class=""><article_addi class=""></fa fa-plusi></a></dd>
</dl> <dl class="">
classify_list js_list <dt>
<div class=""><js_column_wrapi class=""></fa fa-calendari><span class="">文章存档</columnspan></div>
<ul id="" article_list1class="">
article_list
<li><a href="">2017年06月<//huiwenjie168/article/month/2017/06a><span>(1)</span></li> <li><a href="">2016年12月<//huiwenjie168/article/month/2016/12a><span>(1)</span></li> <li><a href="">2016年06月<//huiwenjie168/article/month/2016/06a><span>(3)</span></li> <li><a href="">2015年12月<//huiwenjie168/article/month/2015/12a><span>(1)</span></li> <li><a href="">2015年11月<//huiwenjie168/article/month/2015/11a><span>(1)</span></li> <li><a href="">2015年09月<//huiwenjie168/article/month/2015/09a><span>(1)</span></li> <li><a href="">2015年04月<//huiwenjie168/article/month/2015/04a><span>(1)</span></li> <li><a href="">2014年12月<//huiwenjie168/article/month/2014/12a><span>(1)</span></li> <li><a href="">2014年05月<//huiwenjie168/article/month/2014/05a><span>(7)</span></li> <li><a href="">2013年11月<//huiwenjie168/article/month/2013/11a><span>(1)</span></li> <li><a href="">2013年06月<//huiwenjie168/article/month/2013/06a><span>(3)</span></li> <li><a href="">2013年05月<//huiwenjie168/article/month/2013/05a><span>(1)</span></li> <li><a href="">2013年04月<//huiwenjie168/article/month/2013/04a><span>(1)</span></li> <li><a href="">2013年01月<//huiwenjie168/article/month/2013/01a><span>(4)</span></li> <li><a href="">2012年12月<//huiwenjie168/article/month/2012/12a><span>(1)</span></li> <li><a href="">2012年10月<//huiwenjie168/article/month/2012/10a><span>(1)</span></li> <li><a href="">2012年09月<//huiwenjie168/article/month/2012/09a><span>(1)</span></li> <li><a href="">2012年08月<//huiwenjie168/article/month/2012/08a><span>(1)</span></li> <li><a href="">2012年07月<//huiwenjie168/article/month/2012/07a><span>(2)</span></li> <li><a href="">2012年06月<//huiwenjie168/article/month/2012/06a><span>(1)</span></li> <li><a href="">2012年05月<//huiwenjie168/article/month/2012/05a><span>(7)</span></li> <li><a href="">2012年03月<//huiwenjie168/article/month/2012/03a><span>(1)</span></li> <li><a href="">2012年02月<//huiwenjie168/article/month/2012/02a><span>(11)</span></li> <li><a href="">2011年12月<//huiwenjie168/article/month/2011/12a><span>(4)</span></li> <li><a href="">2011年11月<//huiwenjie168/article/month/2011/11a><span>(16)</span></li> <li><a href="">2011年10月<//huiwenjie168/article/month/2011/10a><span>(4)</span></li> </ul>
</dt>
</dl> <dl class="">
classify_list js_list <dt>
<div class=""><js_column_wrapi class=""></fa fa-eyei><span class="">阅读排行</columnspan></div>
<ul class="">
article_list
<li><a href="">BigDecimal加减乘除运算<//huiwenjie168/article/details/6998140a><span>(139370)</span></li> <li><a href="">org.hibernate.exception.SQLGrammarException: could not execute query处理方式<//huiwenjie168/article/details/7017680a><span>(31657)</span></li> <li><a href="">Tomcat内存,并发数配置<//huiwenjie168/article/details/7019303a><span>(27150)</span></li> <li><a href="">spring加载hibernate映射文件的几种方式<//huiwenjie168/article/details/7013618a><span>(23033)</span></li> <li><a href="">c3p0、dbcp、tomcat jdbc pool 连接池配置简介及常用数据库的driverClass和驱动包<//huiwenjie168/article/details/8477967a><span>(18385)</span></li> <li><a href="">免装版tomcat注册成windows系统服务方法<//huiwenjie168/article/details/42267353a><span>(17917)</span></li> <li><a href="">java根据IP获取用户所在地<//huiwenjie168/article/details/16898619a><span>(17158)</span></li> <li><a href="">用iText给pdf添加水印图片<//huiwenjie168/article/details/7616983a><span>(16394)</span></li> <li><a href="">关于Ireport的使用技巧<//huiwenjie168/article/details/6997817a><span>(11246)</span></li> <li><a href="">PowerDesigner15.1创建模型及生成带注释sql操作手册<//huiwenjie168/article/details/7824029a><span>(11160)</span></li> </ul>
</dt>
</dl> <dl class="">
classify_list js_list <dt>
<div class=""><js_column_wrapi class=""></fa fa-commentsi><span class="">评论排行</columnspan></div>
<ul class="">
article_list
<li><a href="">用iText给pdf添加水印图片<//huiwenjie168/article/details/7616983a><span>(14)</span></li> <li><a href="">java获取新浪天气预报代码<//huiwenjie168/article/details/27332779a><span>(10)</span></li> <li><a href="">BigDecimal加减乘除运算<//huiwenjie168/article/details/6998140a><span>(9)</span></li> <li><a href="">java根据IP获取用户所在地<//huiwenjie168/article/details/16898619a><span>(6)</span></li> <li><a href="">验证身份证号方法<//huiwenjie168/article/details/42142339a><span>(3)</span></li> <li><a href="">java开发常用jar包<//huiwenjie168/article/details/7049481a><span>(3)</span></li> <li><a href="">java程序调用iReport生成的.jasper文件的方法<//huiwenjie168/article/details/7286963a><span>(3)</span></li> <li><a href="">java.lang.IllegalArgumentException: node to traverse cannot be null! 处理方法<//huiwenjie168/article/details/7019276a><span>(2)</span></li> <li><a href="">PowerDesigner15.1创建模型及生成带注释sql操作手册<//huiwenjie168/article/details/7824029a><span>(2)</span></li> <li><a href="">原来冒泡不是最牛的排序方法<//huiwenjie168/article/details/7252919a><span>(2)</span></li> </ul>
</dt>
</dl> <dl class="">
classify_list js_list <dt>
<div class=""><js_column_wrapi class=""></fa fa-list-oli><span class="">推荐文章</columnspan></div>
<ul class="">
article_list <ul>
<li><a href="" http://blog.csdn.net/blogdevteam/article/details/75086638target="">* CSDN日报20170713——《程序人生,终究是起承转合》</_blanka></li>
<li><a href=""
http://blog.csdn.net/phodal/article/details/74516182target="">* 探讨后端选型中不同语言及对应的Web框架</_blanka></li>
<li><a href=""http://blog.csdn.net/briblue/article/details/74616922target="">* 细说反射,Java 和 Android 开发者必须跨越的坎</_blanka></li>
<li><a href=""
http://blog.csdn.net/xiaopihaierletian/article/details/74688643target="">* 深度学习 | 反向传播与它的直观理解</_blanka></li>
<li><a href=""
http://blog.csdn.net/liyuanxiang1984/article/details/74611136target="">* ArcGIS 水文分析实战教程——雨量计算与流量统计</_blanka></li>
<li><a href=""
http://blog.csdn.net/broadview2006/article/details/74431515target="">* 每周荐书:Android、Keras、ES6(评论送书)</_blanka></li> </ul>
</ul>
</dt>
</dl> <dl class="">
classify_list js_list <dt>
<div class=""><js_column_wrapi class=""></fa fa-commentingi><span class="">最新评论</columnspan></div>
<ul class="">
article_list new_comment
<li>
<p><a href="">java获取新浪天气预报代码<//huiwenjie168/article/details/27332779a></p>
<p><a href="" /huiwenjie168class="">huiwenjie168</reply_namea><span>回复:</span></p>
<p class=""><reply_cem></em><i>@qq_35476379:你能那到天气情况,图片还不好设置吗?http://www.17sucai....</i></p>
</li> <li>
<p><a href="">java获取新浪天气预报代码</a></p>
<p><a href="" /qq_35476379class="">qq_35476379</reply_namea><span>回复:</span></p>
<p class=""><reply_cem></em><i>有个问题请教下,我看返回的数据中没有天气对应图片的数据哦,新浪天气获取不到天气图片的吗?</i></p>
</li> <li>
<p><a href="">org.hibernate.exception.SQLGrammarException: could not execute query处理方式<//huiwenjie168/article/details/7017680a></p>
<p><a href="" /yiwangxiblogclass="">yiwangxiblog</reply_namea><span>回复:</span></p>
<p class=""><reply_cem></em><i>感谢分享</i></p>
</li> <li>
<p><a href="">java.lang.IllegalArgumentException: node to traverse cannot be null! 处理方法<//huiwenjie168/article/details/7019276a></p>
<p><a href="" /wangjinlong_class="">wangjinlong_</reply_namea><span>回复:</span></p>
<p class=""><reply_cem></em><i>解决了,</i></p>
</li> <li>
<p><a href="">用iText给pdf添加水印图片<//huiwenjie168/article/details/7616983a></p>
<p><a href="" /u014335844class="">u014335844</reply_namea><span>回复:</span></p>
<p class=""><reply_cem></em><i>图片本身有要求吗,格式方面</i></p>
</li> <li>
<p><a href="">spring+mybatis使用MapperScannerConfigurer引起的PropertyPlaceholderConfigurer无效问题处理方法<//huiwenjie168/article/details/51722290a></p>
<p><a href="" /a769901686class="">a769901686</reply_namea><span>回复:</span></p>
<p class=""><reply_cem></em><i>我也试了,不行,也看不出来,上面两个的配置除了改了SqlSessionFactoryBean的id名...</i></p>
</li> <li>
<p><a href="">spring加载hibernate映射文件的几种方式<//huiwenjie168/article/details/7013618a></p>
<p><a href="" /foaicaiqingclass="">foaicaiqing</reply_namea><span>回复:</span></p>
<p class=""><reply_cem></em><i>大神,谢谢了</i></p>
</li> <li>
<p><a href="">免装版tomcat注册成windows系统服务方法<//huiwenjie168/article/details/42267353a></p>
<p><a href="" /xiaoqingwa0214class="">xiaoqingwa0214</reply_namea><span>回复:</span></p>
<p class=""><reply_cem></em><i>很有帮助</i></p>
</li> <li>
<p><a href="">BigDecimal加减乘除运算<//huiwenjie168/article/details/6998140a></p>
<p><a href="" /qq_18843045class="">qq_18843045</reply_namea><span>回复:</span></p>
<p class=""><reply_cem></em><i>double处理是有问题的,2245.325试着保留2位小数位看看</i></p>
</li> <li>
<p><a href="">java根据IP获取用户所在地<//huiwenjie168/article/details/16898619a></p>
<p><a href="" /wanggangjiaclass="">wanggangjia</reply_namea><span>回复:</span></p>
<p class=""><reply_cem></em><i>挺不错 正如楼上所说 ip要用外网的才行</i></p>
</li> </ul>
</dt>
</dl> <!--
[startblogcolumn]
[startsearch]
<dl class="classify_list">
<div class="article_search">
<div class="article_search_c">
<form id="frmSearch" action="http://so.csdn.net/search" class="form_search csdn-tracking-statistics" target="_blank" data-mod="popu_306">
<input type="text" id="inputSearch" placeholder="文章搜索"><i class="fa fa-search" id="btnSubmit"></i>
</form>
</div>
</div>
</dl>
<script type="text/javascript"> $(function () {
$("#btnSubmit").unbind("click");
$("#btnSubmit").click(function () {
search();
}); $("#frmSearch").submit(function () {
search();
return false;
}); function search()
{
if ($("#inputSearch").val() == "") {
alert("请录入搜索关键词!");
return false;
}
//var url = "http://so.csdn.net/so/search/s.do?q=" + encodeURIComponent($("#inputSearch").val()) + "&u=" + username + "&t=blog";
var url = "https://www.baidu.com/s?wd=" + encodeURIComponent($("#inputSearch").val()) + "%20site%3Ablog.csdn.net"
window.location.href = url;
}
});
</script>
[endsearch] [startspecialcolumn]
<dl class="classify_list">
<dt><i class="fa fa-file-text"></i><a href="/huiwenjie168/blog/column" class="column">博客专栏</a> </dt>
</dl>
[endspecialcolumn] [startcategory]
<dl class="classify_list js_list">
<dt>
<div class="js_column_wrap"><i class="fa fa-th"></i><span class="column">文章分类</span></div>
<ul id="article_list0" class="article_list">
{articlecategorys}
</ul>
</dt>
<dd style="display:none"><a href="#" class="article_add"><i class="fa fa-plus"></i></a></dd>
</dl>
[endcategory] [startarchive]
<dl class="classify_list js_list">
<dt>
<div class="js_column_wrap"><i class="fa fa-calendar"></i><span class="column">文章存档</span></div>
<ul id="article_list1" class="article_list">
[startlist]
<li><a href="/{0}/article/month/{1}/{2}">{1}年{2}月</a><span>({3})</span></li>
[endlist]
</ul>
</dt>
</dl>
[endarchive]
[startviewcountarticles]
<dl class="classify_list js_list">
<dt>
<div class="js_column_wrap"><i class="fa fa-eye"></i><span class="column">阅读排行</span></div>
<ul class="article_list">
[startlist]
<li><a href="{columnarticleurl}">{columnarticletitle}</a><span>({columnarticlecount})</span></li>
[endlist]
</ul>
</dt>
</dl>
[endviewcountarticles]
[startcommentcountarticles]
<dl class="classify_list js_list">
<dt>
<div class="js_column_wrap"><i class="fa fa-comments"></i><span class="column">评论排行</span></div>
<ul class="article_list">
[startlist]
<li><a href="{columnarticleurl}">{columnarticletitle}</a><span>({columnarticlecommentcount})</span></li>
[endlist]
</ul>
</dt>
</dl>
[endcommentcountarticles]
[starthomepagearticles]
<dl class="classify_list js_list">
<dt>
<div class="js_column_wrap"><i class="fa fa-list-ol"></i><span class="column">推荐文章</span></div>
<ul class="article_list">
{cloumcontent}
</ul>
</dt>
</dl>
[endhomepagearticles]
[startnewcomments]
<dl class="classify_list js_list">
<dt>
<div class="js_column_wrap"><i class="fa fa-commenting"></i><span class="column">最新评论</span></div>
<ul class="article_list new_comment">
[startlist]
<li>
<p><a href="{articleurl}">BigDecimal加减乘除运算</a></p>
<p><a href="/{commentusername}" class="reply_name">{commentusername}</a><span>回复:</span></p>
<p class="reply_c"><em></em><i>{commentcontent}</i></p>
</li>
[endlist]
</ul>
</dt>
</dl>
[endnewcomments]
[startcustom]
<dl class="classify_list js_list">
<dt>
<div class="js_column_wrap"><i class="fa fa-cube"></i><span class="column">{columntitle}</span></div>
<ul class="article_list">
{columcontent}
</ul>
</dt>
</dl>
[endcustom]
[endblogcolumn]
--> <!--
<dl class="classify_list">
<dt class="rss"><i class="fa fa-rss"></i>
<span class="column">
<a href="http://blog.csdn.net/huiwenjie168/rss/list" class="column" onclick="_gaq.push(['_trackEvent','function', 'onclick', 'blog_articles_RSS'])">RSS订阅</a>
</span>
</dt>
</dl>
--> </div>
</div>
</div>
</div>
<div id="" skin_right_smallclass="">
skin_right_small <div class=""><skin_r_smalli id="" faNaviconclass=""></fa fa-naviconi>
<div class=""><head_smalla href=""><http://my.csdn.net/huiwenjie168img src="" http://avatar.csdn.net/3/A/4/1_huiwenjie168.jpgalt=""></imga></div>
<ul class="">
rSmallList <li class=""><small_articlei class=""></fa fa-file-texti><a href="" /huiwenjie168/blog/columnclass="">博客专栏</small_columna></li> <li class=""><small_article js_smallArticlei class=""></fa fa-thi><a href="" #class="">文章分类</small_columna></li> <li class=""><small_article js_smallArticlei class=""></fa fa-calendari><a href="" #class="">文章存档</small_columna></li> <li class=""><small_article js_smallArticlei class=""></fa fa-eyei><a href="" #class="">阅读排行</small_columna></li> <li class=""><small_article js_smallArticlei class=""></fa fa-commentsi><a href="" #class="">评论排行</small_columna></li> <li class=""><small_article js_smallArticlei class=""></fa fa-list-oli><a href="" #class="">推荐文章</small_columna></li> <li class=""><small_article js_smallArticlei class=""></fa fa-commentingi><a href="" #class="">最新评论</small_columna></li> <!--
[startblogcolumnsmall]
[startspecialcolumn]
<li class="small_article"><i class="fa fa-file-text"></i><a href="/huiwenjie168/blog/column" class="small_column">博客专栏</a></li>
[endspecialcolumn]
[startcategory]
<li class="small_article js_smallArticle"><i class="fa fa-th"></i><a href="#" class="small_column">文章分类</a></li>
[endcategory]
[startarchive]
<li class="small_article js_smallArticle"><i class="fa fa-calendar"></i><a href="#" class="small_column">文章存档</a></li>
[endarchive]
[startviewcountarticles]
<li class="small_article js_smallArticle"><i class="fa fa-eye"></i><a href="#" class="small_column">阅读排行</a></li>
[endviewcountarticles]
[startcommentcountarticles]
<li class="small_article js_smallArticle"><i class="fa fa-comments"></i><a href="#" class="small_column">评论排行</a></li>
[endcommentcountarticles]
[starthomepagearticles]
<li class="small_article js_smallArticle"><i class="fa fa-list-ol"></i><a href="#" class="small_column">推荐文章</a></li>
[endhomepagearticles]
[startnewcomments]
<li class="small_article js_smallArticle"><i class="fa fa-commenting"></i><a href="#" class="small_column">最新评论</a></li>
[endnewcomments]
[startcustom]
<li class="small_article js_smallArticle"><i class="fa fa-cube"></i><a href="#" class="small_column">{columntitle}</a></li>
[endcustom]
[endblogcolumnsmall]
-->
</ul>
</div>
</div> <div id=""></maskdiv>
<script type="" text/javascriptsrc=""></http://static.blog.csdn.net/skin/skin2-template/js/apps/accordion.jsscript> <script type="" text/javascriptsrc=""></http://static.blog.csdn.net/skin/skin2-template/js/apps/jquery.mousewheel.jsscript>
<script type="" text/javascriptsrc=""></http://static.blog.csdn.net/skin/skin2-template/js/apps/jquery.rollbar.min.jsscript> <script type="" text/javascriptsrc=""></http://static.blog.csdn.net/skin/skin2-template/js/apps/transition.jsscript>
<script id="" noticeScripttype="" text/javascriptcharset="" utf-8btnId="" header_notice_numwrapId="" note1count="" 5subCount="" 5src=""></http://c.csdnimg.cn/public/common/toolbar/js/notify.jsscript>
<!--script( type="text/javascript" src="http://csdnimg.cn/pubfooter/js/publib_footer.js" )-->
<!--script( type="text/javascript" src="http://static.csdn.net/public/common/toolbar/js/toolbar.js" )-->
<script id="" csdn-toolbar-idbtnId="" header_notice_numwrapId="" note1count="" 5subCount="" 5type="" text/javascriptsrc=""></http://c.csdnimg.cn/public/common/toolbar/js/toolbar.jsscript> <div id="" pop_winstyle="">
display:none ;position: absolute; z-index: 10000; border: 1px solid rgb(220, 220, 220); top: 222.5px; left: 630px; opacity: 1; background: none 0px 0px repeat scroll rgb(255, 255, 255);
</div>
<div id="">
report_dialog </div> <div id=""></popup_maskdiv>
<style type="">
text/css #popup_mask
{
position: absolute;
width: 100%;
height: 100%;
background: #000;
z-index: 9999;
left: 0px;
top: 0px;
opacity: 0.3;
filter: alpha(opacity=30);
display: none;
} .skin_list dl dd div ol {
margin-left:15px;
} .skin_list dl dd div ol li {
display:list-item;list-style-type:decimal;margin-left:15px;
} </style> <div id="" a52b5334dstyle="">
width: 1px; height: 1px; display: none; <script id=""></adJs52b5334script>
<script>document.getElementById("adJs52b5334").src = "http://ads.csdn.net/js/opt/52b5334.js?t=" + Math.random();</script>
</div> <!-- 广告位开始 -->
<ins data-revive-zoneid="" 72data-revive-id=""></8c38e720de1c90a6f6ff52f3f89c4d57ins>
<!-- 广告位结束 --> <link rel="" stylesheethref="" />
http://static.blog.csdn.net/css/blog_code.css <script type="" text/javascriptsrc=""></http://static.blog.csdn.net/scripts/saveToCode.jsscript>
<script type="" text/javascriptsrc=""//csdnimg.cn/rabbit/tracking-ad/main.js?75eacd8></script> </body>
</html>
<script language=javascript" type="" text/javascriptsrc=""></http://ads.csdn.net/js/async_new.jsscript> <script type="">
text/javascript var fromjs=$("#fromjs");
if(fromjs.length>0)
{
$("#fromjs .markdown_views pre").addClass("prettyprint");
prettyPrint(); $('pre.prettyprint code').each(function () {
var lines = $(this).text().split('\n').length;
var $numbering = $('<ul/>').addClass('pre-numbering').hide();
$(this).addClass('has-numbering').parent().append($numbering);
for (i = 1; i <= lines; i++) {
$numbering.append($('<li/>').text(i));
};
$numbering.fadeIn(1700);
}); $('.pre-numbering li').css("color","#999");
} $(function(){
setTimeout(function(){
$(".math").each(function(index,value){$(this).find("span").last().css("color","#fff"); })
},500); }); </script>

BigDecimal加减乘除运算(转)的更多相关文章

  1. BigDecimal加减乘除运算

    java.math.BigDecimal.BigDecimal一共有4个够造方法,让我先来看看其中的两种用法: 第一种:BigDecimal(double val)Translates a doubl ...

  2. Java BigDecimal 加减乘除运算

    加法:add 减法:subtract 乘法:multiply 除法:divide BigDecimal bignum1 = new BigDecimal("10"); BigDec ...

  3. 精确的double加减乘除运算工具类

    import java.math.BigDecimal; /** * 精确的double加减乘除运算 * @author cyf * */ public class DoubleUtil { /** ...

  4. Java中的Bigdecimal类型运算

    Java中的Bigdecimal类型运算 双精度浮点型变量double可以处理16位有效数.在实际应用中,需要对更大或者更小的数进行运算和处理.Java在java.math包中提 供的API类BigD ...

  5. BigDecimal除法运算出现java&period;lang&period;ArithmeticException&colon; Non-terminating decimal expansion&semi; no exact representable decimal result的解决办法

    BigDecimal除法运算出现java.lang.ArithmeticException: Non-terminating decimal expansion; no exact represent ...

  6. 新浪面试题:只允许使用&plus;&plus;操作符实现加减乘除运算&lpar;c语言版&rpar;

    //假定a,b都是正整数,只允许使用++而不使用-,--,*,/操作符的情况下实现加减乘除运算 //使用++实现加法: int jiafa(int a,int b){ for (int i=0;i&l ...

  7. java BigDecimal实现精确加减乘除运算

    java.math.BigDecimal.BigDecimal一共有4个够造方法,让我先来看看其中的两种用法: 第一种:BigDecimal(double val)Translates a doubl ...

  8. 电商网站中价格的精确计算(使用BigDecimal进行精确运算&lpar;实现加减乘除运算&rpar;)

    使用BigDecimal的String的构造器.商业计算中,使用bigdecimal的String构造器,一定要用. 重要的事情说三遍: 商业计算中,使用bigdecimal的String构造器! 商 ...

  9. Java BigDecimal类型的 加减乘除运算

    原文: https://blog.csdn.net/xuwei_net/article/details/81253471 加法:add 减法:subtract 乘法:multiply 除法:divid ...

随机推荐

  1. English Training Material - 03

    Cross-cultural understanding (2) 1 The following text is about cultural diversity. Read it through o ...

  2. Mongodb 笔记08 了解应用的动态、数据管理、持久性

    了解应用的动态 1. 了解正在进行的操作:db.currentOp() , 可以加过滤条件,从而只显示符合条件的结果. 1). 寻找有问题的操作:db.currentOp() 最常见的操作就是用来寻找 ...

  3. Python 学习入门(22)—— 线程同步

    Python主要通过标准库中的threading包来实现多线程.在当今网络时代,每个服务器都会接收到大量的请求.服务器可以利用多线程的方式来处理这些请求,以提高对网络端口的读写效率.Python是一种 ...

  4. EF6中使用事务的方法

    默认情况当你执行SaveChanges()的时候(insert update delete)来操作数据库时,Entity Framework会把这个操作包装在一个事务里,当操作结束后,事务也结束了. ...

  5. 我的Java设计模式-原型模式

    "不好意思,我是卧底!哇哈哈哈~"额......自从写了上一篇的观察者模式,就一直沉浸在这个角色当中,无法自拨.昨晚在看<使徒行者2>,有一集说到啊炮仗哥印钞票,我去, ...

  6. 小黄衫 Get

    小黄衫 Get .   十分荣幸在前四次作业中以微弱的3分之差拿到了第一,获得了本次的小黄衫. 先发点牢骚.. 讲道理,原本以为的研究生生涯应该就是埋在论文堆里度过的时候顺便上上课.当初选课的时候,学 ...

  7. 原生js获取pc和移动端屏幕宽、高的方法

    pc端: var w = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; ...

  8. Jdk 接口类RandomAccess了解

    1. 接口说明 Marker interface used by List implementations to indicate that they support fast (generally ...

  9. 【BZOJ5499】&lbrack;2019省队联测&rsqb;春节十二响(贪心)

    [BZOJ5499][2019省队联测]春节十二响(贪心) 题面 BZOJ 洛谷 题解 如果是一条折链,显然维护两侧的值,每次两个堆分别弹出一个\(max\)然后合并一下,最后再放回去就可以了. 那么 ...

  10. CXF使用JMS作为传输协议的配置

    <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w ...