亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? bigdecimal.java

?? java源代碼 請(qǐng)看看啊 提點(diǎn)寶貴的意見
?? JAVA
?? 第 1 頁(yè) / 共 3 頁(yè)
字號(hào):
/* * Copyright 2003 Sun Microsystems, Inc. All rights reserved. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. *//* * @(#)BigDecimal.java	1.42 03/01/23 */package java.math;/** * Immutable, arbitrary-precision signed decimal numbers.  A BigDecimal * consists of an arbitrary precision integer <i>unscaled value</i> and a * non-negative 32-bit integer <i>scale</i>, which represents the number of * digits to the right of the decimal point.  The number represented by the * BigDecimal is <tt>(unscaledValue/10<sup>scale</sup>)</tt>.  BigDecimal * provides operations for basic arithmetic, scale manipulation, comparison, * hashing, and format conversion. * <p> * The BigDecimal class gives its user complete control over rounding * behavior, forcing the user to explicitly specify a rounding * behavior for operations capable of discarding precision ({@link * #divide(BigDecimal, int)}, {@link #divide(BigDecimal, int, int)}, * and {@link #setScale}).  Eight <em>rounding modes</em> are provided * for this purpose. * <p> * Two types of operations are provided for manipulating the scale of a * BigDecimal: scaling/rounding operations and decimal point motion * operations.  Scaling/rounding operations (<tt>setScale</tt>) return a * BigDecimal whose value is approximately (or exactly) equal to that of the * operand, but whose scale is the specified value; that is, they increase or * decrease the precision of the number with minimal effect on its value. * Decimal point motion operations ({@link #movePointLeft} and * {@link #movePointRight}) return a BigDecimal created from the operand by * moving the decimal point a specified distance in the specified direction; * that is, they change a number's value without affecting its precision. * <p> * For the sake of brevity and clarity, pseudo-code is used throughout the * descriptions of BigDecimal methods.  The pseudo-code expression * <tt>(i + j)</tt> is shorthand for "a BigDecimal whose value is * that of the BigDecimal <tt>i</tt> plus that of the BigDecimal <tt>j</tt>." * The pseudo-code expression <tt>(i == j)</tt> is shorthand for * "<tt>true</tt> if and only if the BigDecimal <tt>i</tt> represents the same * value as the the BigDecimal <tt>j</tt>."  Other pseudo-code expressions are * interpreted similarly.  * <p> * Note: care should be exercised if BigDecimals are to be used as * keys in a {@link java.util.SortedMap} or elements in a {@link * java.util.SortedSet}, as BigDecimal's <i>natural ordering</i> is * <i>inconsistent with equals</i>.  See {@link Comparable}, {@link * java.util.SortedMap} or {@link java.util.SortedSet} for more * information. * <p> * All methods and constructors for this class * throw <CODE>NullPointerException</CODE> when passed * a null object reference for any input parameter. * * @see     BigInteger * @see	    java.util.SortedMap * @see	    java.util.SortedSet * @version 1.42, 01/23/03 * @author Josh Bloch */public class BigDecimal extends Number implements Comparable {    /**     * The unscaled value of this BigDecimal, as returned by unscaledValue().     *     * @serial     * @see #unscaledValue     */    private BigInteger intVal;    /**     * The scale of this BigDecimal, as returned by scale().     *     * @serial     * @see #scale     */    private int	       scale = 0;    /* Appease the serialization gods */    private static final long serialVersionUID = 6108874887143696463L;    // Constructors        /**     * Translates the String representation of a BigDecimal into a     * BigDecimal.  The String representation consists of an optional     * sign, <tt>'+'</tt> (<tt>'&#92;u002B'</tt>) or <tt>'-'</tt>     * (<tt>'&#92;u002D'</tt>), followed by a sequence of zero or more     * decimal digits ("the integer"), optionally followed by a     * fraction, optionally followed by an exponent.     *     * <p>The fraction consists of of a decimal point followed by zero or more     * decimal digits.  The string must contain at least one digit in either     * the integer or the fraction.  The number formed by the sign, the     * integer and the fraction is referred to as the <i>significand</i>.     *     * <p>The exponent consists of the character <tt>'e'</tt>     * (<tt>'&#92;u0075'</tt>) or <tt>'E'</tt> (<tt>'&#92;u0045'</tt>)     * followed by one or more decimal digits.  The value of the     * exponent must lie between -{@link Integer#MAX_VALUE} ({@link     * Integer#MIN_VALUE}+1) and {@link Integer#MAX_VALUE}, inclusive.     *     * <p>More formally, the strings this constructor accepts are     * described by the following grammar:     * <blockquote>     * <dl>     * <dt><i>BigDecimalString:</i>     * <dd><i>Sign<sub>opt</sub> Significand Exponent<sub>opt</sub></i>     * <p>     * <dt><i>Sign:</i>     * <dd><code>+</code>     * <dd><code>-</code>     * <p>     * <dt><i>Significand:</i>     * <dd><i>IntegerPart</i> <code>.</code> <i>FractionPart<sub>opt</sub></i>     * <dd><code>.</code> <i>FractionPart</i>     * <dd><i>IntegerPart</i>     * <p>     * <dt><i>IntegerPart:     * <dd>Digits</i>     * <p>     * <dt><i>FractionPart:     * <dd>Digits</i>     * <p>     * <dt><i>Exponent:     * <dd>ExponentIndicator SignedInteger</i>     * <p>     * <dt><i>ExponentIndicator:</i>     * <dd><code>e</code>     * <dd><code>E</code>     * <p>     * <dt><i>SignedInteger:     * <dd>Sign<sub>opt</sub> Digits</i>     * <p>     * <dt><i>Digits:     * <dd>Digit     * <dd>Digits Digit</i>     * <p>     * <dt><i>Digit:</i>     * <dd>any character for which {@link Character#isDigit}     * returns <code>true</code>, including 0, 1, 2 ...     * </dl>     * </blockquote>     *     * <p>The scale of the returned BigDecimal will be the number of digits in     * the fraction, or zero if the string contains no decimal point, subject     * to adjustment for any exponent:  If the string contains an exponent, the     * exponent is subtracted from the scale.  If the resulting scale is     * negative, the scale of the returned BigDecimal is zero and the unscaled     * value is multiplied by the appropriate power of ten so that, in every     * case, the resulting BigDecimal is equal to <i>significand</i> &times;     * 10<i><sup>exponent</sup></i>. (If in the future this specification is      * amended to permit negative scales, the final step of zeroing the scale     * and adjusting the unscaled value will be eliminated.)     *     * <p>The character-to-digit mapping is provided by {@link     * java.lang.Character#digit} set to convert to radix 10.  The     * String may not contain any extraneous characters (whitespace,     * for example).     *     * <p>Note: For values other <tt>float</tt> and <tt>double</tt>     * NaN and &plusmn;Infinity, this constructor is compatible with     * the values returned by {@link Float#toString} and {@link     * Double#toString}.  This is generally the preferred way to     * convert a <tt>float</tt> or <tt>double</tt> into a BigDecimal,     * as it doesn't suffer from the unpredictability of the {@link     * #BigDecimal(double)} constructor.     *     * <p>Note: the optional leading plus sign and trailing exponent were     * added in release 1.3.     *     * @param val String representation of BigDecimal.     * @throws NumberFormatException <tt>val</tt> is not a valid representation     *	       of a BigDecimal.     */    public BigDecimal(String val) {        // Empty string not accepted        if (val.length() == 0)            throw new NumberFormatException();        // Deal with leading plus sign if present        if (val.charAt(0) == '+') {            val = val.substring(1);      /* Discard leading '+' */	    if (val.length() == 0 || 	 /* "+" illegal! */		val.charAt(0) == '-')	 /* "+-123.456" illegal! */		throw new NumberFormatException();        }        // If exponent is present, break into exponent and significand        int exponent = 0;	int ePos = val.indexOf('e');        if (ePos == -1)            ePos = val.indexOf('E');        if (ePos != -1) {            String exp = val.substring(ePos+1);            if (exp.length() == 0)              /* "1.2e" illegal! */                throw new NumberFormatException();            if (exp.charAt(0) == '+') {                exp = exp.substring(1);         /* Discard leading '+' */                if (exp.length() == 0 ||	/* "123.456e+" illegal! */		    exp.charAt(0) == '-')       /* "123.456e+-7" illegal! */                    throw new NumberFormatException();            }            exponent = Integer.parseInt(exp);            if (ePos==0)		throw new NumberFormatException(); /* "e123" illegal! */            val = val.substring(0, ePos);        }        // Parse significand	int pointPos = val.indexOf('.');	if (pointPos == -1) {			 /* e.g. "123" */	    intVal = new BigInteger(val);	} else if (pointPos == val.length()-1) { /* e.g. "123." */	    intVal = new BigInteger(val.substring(0, val.length()-1));	} else {    /* Fraction part exists */            if (val.charAt(pointPos+1) == '-')	 /* ".-123" illegal! */		throw new NumberFormatException();                        char[] digits = new char[val.length()-1];            // Get chars before decimal point            val.getChars(0, pointPos, digits, 0);            // Get chars after decimal point            val.getChars(pointPos+1, val.length(), digits, pointPos);	    scale = val.length() - pointPos - 1;            intVal = new BigInteger(digits);	}        // Combine exponent into significand	assert (scale >= 0);  // && scale <= Integer.MAX_VALUE	long longScale = (long)scale - (long)exponent; 	// Avoid errors 							// in calculating scale	if(longScale > Integer.MAX_VALUE)	    throw new NumberFormatException("Final scale out of range");        scale = (int)longScale;	assert (scale == longScale && // conversion should be exact		Math.abs(longScale) <= Integer.MAX_VALUE)  // exponent range 	    						   // check	    :longScale;        if (scale < 0) {            intVal = timesTenToThe(intVal, -scale);            scale = 0;        }    }    /**     * Translates a <code>double</code> into a BigDecimal.  The scale     * of the BigDecimal is the smallest value such that     * <tt>(10<sup>scale</sup> * val)</tt> is an integer.     * <p>     * Note: the results of this constructor can be somewhat unpredictable.     * One might assume that <tt>new BigDecimal(.1)</tt> is exactly equal     * to .1, but it is actually equal     * to .1000000000000000055511151231257827021181583404541015625.     * This is so because .1 cannot be represented exactly as a double     * (or, for that matter, as a binary fraction of any finite length).     * Thus, the long value that is being passed <i>in</i> to the constructor      * is not exactly equal to .1, appearances notwithstanding.     * <p>     * The (String) constructor, on the other hand, is perfectly predictable:     * <tt>new BigDecimal(".1")</tt> is <i>exactly</i> equal to .1, as one     * would expect.  Therefore, it is generally recommended that the (String)     * constructor be used in preference to this one.     *     * @param val <code>double</code> value to be converted to BigDecimal.     * @throws NumberFormatException <tt>val</tt> if <tt>val</tt> is     *         infinite or NaN.     */    public BigDecimal(double val) {	if (Double.isInfinite(val) || Double.isNaN(val))	    throw new NumberFormatException("Infinite or NaN");	/*	 * Translate the double into sign, exponent and mantissa, according	 * to the formulae in JLS, Section 20.10.22.	 */	long valBits = Double.doubleToLongBits(val);	int sign = ((valBits >> 63)==0 ? 1 : -1);	int exponent = (int) ((valBits >> 52) & 0x7ffL);	long mantissa = (exponent==0 ? (valBits & ((1L<<52) - 1)) << 1				     : (valBits & ((1L<<52) - 1)) | (1L<<52));	exponent -= 1075;	/* At this point, val == sign * mantissa * 2**exponent */	/*	 * Special case zero to to supress nonterminating normalization	 * and bogus scale calculation.	 */	if (mantissa == 0) {	    intVal = BigInteger.ZERO;	    return;	}	/* Normalize */	while((mantissa & 1) == 0) {    /*  i.e., Mantissa is even */	    mantissa >>= 1;	    exponent++;	}	/* Calculate intVal and scale */	intVal = BigInteger.valueOf(sign*mantissa);	if (exponent < 0) {	    intVal = intVal.multiply(BigInteger.valueOf(5).pow(-exponent));	    scale = -exponent;	} else if (exponent > 0) {	    intVal = intVal.multiply(BigInteger.valueOf(2).pow(exponent));	}    }    /**     * Translates a BigInteger into a BigDecimal.  The scale of the BigDecimal     * is zero.     *     * @param val BigInteger value to be converted to BigDecimal.     */    public BigDecimal(BigInteger val) {	intVal = val;    }    /**     * Translates a BigInteger unscaled value and an <code>int</code>     * scale into a BigDecimal.  The value of the BigDecimal is     * <tt>(unscaledVal/10<sup>scale</sup>)</tt>.     *     * @param unscaledVal unscaled value of the BigDecimal.     * @param scale scale of the BigDecimal.     * @throws NumberFormatException scale is negative     */    public BigDecimal(BigInteger unscaledVal, int scale) {	if (scale < 0)	    throw new NumberFormatException("Negative scale");	intVal = unscaledVal;	this.scale = scale;    }    // Static Factory Methods    /**     * Translates a <code>long</code> unscaled value and an     * <code>int</code> scale into a BigDecimal.  This &quot;static factory     * method&quot; is provided in preference to a (<code>long</code>,     * <code>int</code>) constructor because it allows for reuse of     * frequently used BigDecimals.     *     * @param unscaledVal unscaled value of the BigDecimal.     * @param scale scale of the BigDecimal.     * @return a BigDecimal whose value is     *	       <tt>(unscaledVal/10<sup>scale</sup>)</tt>.     */    public static BigDecimal valueOf(long unscaledVal, int scale) {	return new BigDecimal(BigInteger.valueOf(unscaledVal), scale);    }    /**     * Translates a <code>long</code> value into a BigDecimal with a     * scale of zero.  This &quot;static factory method&quot; is provided in     * preference to a (<code>long</code>) constructor because it     * allows for reuse of frequently used BigDecimals.     *

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91在线一区二区三区| 色婷婷综合在线| 亚洲人成在线观看一区二区| 91精品在线免费| 欧美va在线播放| 色婷婷综合在线| 成人亚洲一区二区一| 日韩高清在线一区| 亚洲少妇最新在线视频| 久久精品人人做人人爽97| 欧美日韩aaa| 91精彩视频在线观看| 成人va在线观看| 国产麻豆精品一区二区| 午夜精品一区二区三区免费视频| 久久综合五月天婷婷伊人| 欧美日韩一区二区三区在线 | 精品国产制服丝袜高跟| 91伊人久久大香线蕉| 国产一区二区三区国产| 麻豆91在线播放| 亚洲国产日日夜夜| 亚洲综合图片区| 亚洲精品视频在线观看免费 | 香蕉久久夜色精品国产使用方法 | 美洲天堂一区二卡三卡四卡视频| 亚洲人精品一区| 国产精品沙发午睡系列990531| 日韩美女一区二区三区四区| 在线电影院国产精品| 色94色欧美sute亚洲线路一ni| 成人av资源网站| 成人一区二区在线观看| 成人手机电影网| 不卡av在线网| 91麻豆自制传媒国产之光| 成人综合婷婷国产精品久久 | 欧美一个色资源| 日韩一区二区三区视频在线观看| 欧美日韩成人一区二区| 欧美性xxxxxx少妇| 在线看日韩精品电影| 欧美亚洲免费在线一区| 色噜噜狠狠成人网p站| 色偷偷久久一区二区三区| 在线免费一区三区| 欧美欧美欧美欧美| 91精品在线观看入口| 欧美草草影院在线视频| 久久精品亚洲一区二区三区浴池| 久久先锋资源网| 国产精品无遮挡| 综合欧美亚洲日本| 一区二区三区四区蜜桃 | 日本一区二区不卡视频| 中文字幕免费不卡在线| 亚洲欧美视频在线观看| 亚洲第一激情av| 日韩精品福利网| 韩日av一区二区| 99精品久久免费看蜜臀剧情介绍| 色呦呦一区二区三区| 欧美日韩在线免费视频| 欧美一区永久视频免费观看| 337p日本欧洲亚洲大胆色噜噜| 国产欧美综合在线观看第十页| 亚洲色图视频免费播放| 亚洲成人免费观看| 国模套图日韩精品一区二区| 成人夜色视频网站在线观看| 欧美少妇bbb| 精品国产凹凸成av人导航| 中文字幕在线观看一区| 亚洲成人免费在线观看| 国产一区二区美女诱惑| 一本久道久久综合中文字幕| 欧美一区二区三级| 国产精品视频第一区| 五月天亚洲精品| 国产精品99久久久久久久女警| 91色九色蝌蚪| 欧美va亚洲va在线观看蝴蝶网| 中文字幕中文在线不卡住| 爽爽淫人综合网网站| 成人免费视频app| 91精品国产入口在线| 国产欧美一区视频| 日韩精品一级中文字幕精品视频免费观看| 久久99久久精品欧美| 欧美影院精品一区| 久久久精品国产免费观看同学| 一区二区三区免费| 国产伦精品一区二区三区视频青涩| 在线观看国产一区二区| 久久久久免费观看| 日韩专区欧美专区| 91欧美一区二区| 久久尤物电影视频在线观看| 亚洲一区在线看| 成人av集中营| 精品久久五月天| 亚洲图片欧美色图| 91在线你懂得| 久久精品人人爽人人爽| 免费一级片91| 欧美三级资源在线| 亚洲嫩草精品久久| 国产麻豆视频精品| 欧美变态tickle挠乳网站| 亚洲va欧美va国产va天堂影院| 成人免费高清在线观看| 久久久久9999亚洲精品| 久久精品噜噜噜成人av农村| 欧美在线观看视频在线| 亚洲男人天堂av| 99热这里都是精品| 中文在线免费一区三区高中清不卡| 麻豆久久久久久久| 欧美高清性hdvideosex| 亚洲一二三四在线| 91在线码无精品| 亚洲欧美综合色| 东方欧美亚洲色图在线| 久久精品亚洲一区二区三区浴池| 蜜臀av在线播放一区二区三区 | 国产香蕉久久精品综合网| 美腿丝袜在线亚洲一区| 制服.丝袜.亚洲.另类.中文| 亚洲自拍都市欧美小说| 在线精品视频免费播放| 亚洲老妇xxxxxx| 色婷婷精品大在线视频| 亚洲三级免费观看| 色综合天天在线| 一区二区三区欧美| 欧美视频一区在线观看| 亚洲国产日韩a在线播放性色| 91高清在线观看| 亚洲午夜久久久久久久久久久| 91九色最新地址| 一区二区三区成人在线视频| 欧美在线播放高清精品| 亚洲午夜免费视频| 欧美久久久久久久久中文字幕| 午夜欧美一区二区三区在线播放| 欧美日韩一级视频| 日本成人在线一区| 精品免费一区二区三区| 国产成人午夜99999| 中文字幕欧美三区| 一本大道久久a久久综合婷婷| 一区二区三区在线免费观看| 欧美日韩国产中文| 六月婷婷色综合| 欧美国产激情一区二区三区蜜月| 成人av网站免费观看| 亚洲一二三四在线观看| 欧美一区二区福利视频| 国产精品69毛片高清亚洲| 国产精品久久久久久久久久免费看 | 亚洲午夜激情网页| 欧美一级搡bbbb搡bbbb| 国产在线观看免费一区| 国产精品女上位| 欧美专区在线观看一区| 日韩成人精品在线观看| 久久久综合视频| 色欧美片视频在线观看在线视频| 亚洲成人福利片| 久久精品免费在线观看| 91丨九色丨蝌蚪富婆spa| 日韩精品福利网| 中文字幕 久热精品 视频在线| 欧美图区在线视频| 国产精品中文有码| 亚洲一区在线观看免费观看电影高清 | 亚洲第一综合色| 久久一区二区三区国产精品| 色综合中文字幕国产| 亚洲图片有声小说| 国产清纯在线一区二区www| 日本高清不卡在线观看| 久久99精品国产麻豆不卡| 亚洲视频在线观看一区| 日韩美女主播在线视频一区二区三区| 成人福利视频网站| 免费久久99精品国产| 亚洲激情在线播放| 久久综合狠狠综合久久综合88| 欧美亚洲综合网| 成人自拍视频在线| 奇米精品一区二区三区四区| 亚洲视频中文字幕| 久久久久免费观看| 欧美福利电影网| 色综合久久中文综合久久牛| 国产自产高清不卡| 婷婷久久综合九色国产成人| 亚洲日穴在线视频| 国产三级精品三级在线专区|