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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? bigdecimal.java

?? java源代碼 請看看啊 提點寶貴的意見
?? JAVA
?? 第 1 頁 / 共 3 頁
字號:
/* * 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.     *

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品盗摄一区二区三区| 欧美日韩国产综合一区二区| 日本一区二区在线不卡| 国产一区二区精品久久| 国产精品伦一区| 欧美日韩在线一区二区| 无码av免费一区二区三区试看 | 午夜精品123| 精品奇米国产一区二区三区| 国产在线观看免费一区| 国产精品高潮呻吟久久| 欧美亚洲国产一区二区三区va | 毛片av一区二区三区| 精品国产1区二区| 成人不卡免费av| 亚洲国产日韩一区二区| 日韩精品一区二区三区三区免费| 国产成人av影院| 亚洲一二三四久久| 久久综合国产精品| 色系网站成人免费| 捆绑变态av一区二区三区| 久久精品网站免费观看| 在线观看91精品国产入口| 狠狠色丁香久久婷婷综| 亚洲精品免费在线| 久久人人超碰精品| 欧美亚洲国产一区二区三区va | 精品99一区二区三区| 91小视频免费看| 精品一区二区三区久久| 亚洲精品成人在线| 久久精品视频一区二区| 欧美精品一二三| 99精品热视频| 国产黄色成人av| 日日噜噜夜夜狠狠视频欧美人| 国产精品美女久久久久久久久久久| 欧美二区三区的天堂| a在线欧美一区| 久久er99精品| 亚洲一区二区精品视频| 国产精品天美传媒| 精品女同一区二区| 欧美日韩电影一区| 一本大道av一区二区在线播放| 国产在线乱码一区二区三区| 亚洲成人一区在线| 国产精品污污网站在线观看| www久久久久| 日韩欧美一级片| 国产欧美综合在线观看第十页| 欧美日韩精品专区| 色婷婷精品大在线视频| 白白色亚洲国产精品| 国产一本一道久久香蕉| 青青草伊人久久| 亚洲一区欧美一区| 亚洲日本在线a| 中文字幕不卡的av| 国产网红主播福利一区二区| 亚洲精品在线电影| xfplay精品久久| 日韩精品中文字幕一区二区三区| 欧美精品久久久久久久多人混战 | 亚洲男同性恋视频| 国产亚洲精品免费| 精品国产一区a| 精品少妇一区二区三区| 日韩一区二区电影在线| 日韩视频一区二区三区 | 欧美国产成人精品| 国产色产综合产在线视频| 精品久久久久香蕉网| 日韩你懂的在线观看| 欧美成人精品福利| 精品对白一区国产伦| 久久久噜噜噜久久人人看| 国产丝袜美腿一区二区三区| 欧美激情一区在线观看| 中文字幕一区二区三区在线播放 | 国产精品福利av| 亚洲欧洲日产国码二区| 一区二区三区精密机械公司| 亚洲一区二区中文在线| 国产精品91一区二区| 国产精品一区二区三区99| 岛国av在线一区| 色呦呦一区二区三区| 欧美日韩高清在线播放| 日韩免费在线观看| 91香蕉视频黄| 国产乱国产乱300精品| 精品一区二区影视| 国产又黄又大久久| 国产成人aaa| 99久久免费视频.com| 欧美三级蜜桃2在线观看| 欧美一区二区三区日韩视频| 26uuu国产电影一区二区| 中文字幕在线不卡视频| 午夜日韩在线电影| 国产一区 二区 三区一级| 99热这里都是精品| 91精品国产综合久久福利| 国产视频一区在线播放| 夜夜亚洲天天久久| 黑人精品欧美一区二区蜜桃| 福利一区福利二区| 欧美丝袜丝nylons| 2014亚洲片线观看视频免费| 亚洲欧美视频在线观看视频| 蜜臀av性久久久久av蜜臀妖精| 从欧美一区二区三区| 欧美日韩国产片| 国产欧美一区二区精品性| 国产一区二区三区电影在线观看| 国产成人av在线影院| 欧美日本一区二区三区四区| 国产亚洲va综合人人澡精品 | 91免费视频观看| 日韩写真欧美这视频| 亚洲免费在线观看| 国产自产视频一区二区三区| 在线视频一区二区三| 欧美国产视频在线| 日本亚洲天堂网| 日本韩国一区二区三区| 久久精品欧美一区二区三区麻豆| 三级欧美在线一区| 91丨porny丨国产入口| 日韩免费在线观看| 精品一区二区三区欧美| 色妹子一区二区| 久久久国产精品麻豆 | 国产九九视频一区二区三区| 欧美性xxxxxx少妇| 日韩伦理免费电影| 国产iv一区二区三区| 欧美不卡一区二区三区| 天天亚洲美女在线视频| 日本精品一区二区三区四区的功能| 久久日韩粉嫩一区二区三区| 蜜臀精品一区二区三区在线观看| 色妞www精品视频| 中文字幕一区二区三区视频| 国内成人免费视频| 欧美一二三在线| 婷婷国产在线综合| 欧美日韩黄色一区二区| 一区二区在线免费| 色欧美日韩亚洲| 亚洲色图制服丝袜| 99久久精品国产一区| 国产欧美日韩亚州综合| 国产精品一二三区| 久久久久久亚洲综合影院红桃| 精品伊人久久久久7777人| 欧美一区二区三区免费视频 | 亚洲国产精品激情在线观看| 久久99精品视频| 欧美成va人片在线观看| 精品一区二区免费| 日韩免费高清电影| 麻豆精品一区二区三区| 欧美一级片免费看| 久久机这里只有精品| 欧美mv日韩mv| 国产精品乡下勾搭老头1| 国产欧美日韩久久| 不卡视频在线观看| 亚洲免费在线观看| 欧美日韩一区二区三区在线看| 亚洲综合精品自拍| 欧美群妇大交群中文字幕| 日韩精品一二三四| 欧美变态tickle挠乳网站| 国产在线视频不卡二| 欧美激情一区二区三区| 92精品国产成人观看免费| 亚洲一区二区在线视频| 91精品国产一区二区三区蜜臀| 免费视频一区二区| 久久久久国色av免费看影院| 成人av影院在线| 亚洲午夜精品网| 日韩精品一区国产麻豆| 成人综合婷婷国产精品久久免费| 国产精品嫩草99a| 91极品美女在线| 日本亚洲天堂网| 日本一区二区视频在线观看| 91黄色免费看| 久久av资源站| 中文字幕字幕中文在线中不卡视频| 欧美日韩综合不卡| 久久激五月天综合精品| 亚洲欧洲综合另类| 欧美一区二区免费视频| 成人看片黄a免费看在线|