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

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

?? bigdecimal.java

?? gcc的組建
?? JAVA
字號:
/* java.math.BigDecimal -- Arbitrary precision decimals.   Copyright (C) 1999, 2000, 2001, 2003 Free Software Foundation, Inc.This file is part of GNU Classpath.GNU Classpath is free software; you can redistribute it and/or modifyit under the terms of the GNU General Public License as published bythe Free Software Foundation; either version 2, or (at your option)any later version. GNU Classpath is distributed in the hope that it will be useful, butWITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNUGeneral Public License for more details.You should have received a copy of the GNU General Public Licensealong with GNU Classpath; see the file COPYING.  If not, write to theFree Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA02110-1301 USA.Linking this library statically or dynamically with other modules ismaking a combined work based on this library.  Thus, the terms andconditions of the GNU General Public License cover the wholecombination.As a special exception, the copyright holders of this library give youpermission to link this library with independent modules to produce anexecutable, regardless of the license terms of these independentmodules, and to copy and distribute the resulting executable underterms of your choice, provided that you also meet, for each linkedindependent module, the terms and conditions of the license of thatmodule.  An independent module is a module which is not derived fromor based on this library.  If you modify this library, you may extendthis exception to your version of the library, but you are notobligated to do so.  If you do not wish to do so, delete thisexception statement from your version. */package java.math;public class BigDecimal extends Number implements Comparable{  private BigInteger intVal;  private int scale;  private static final long serialVersionUID = 6108874887143696463L;  /**   * The constant zero as a BigDecimal with scale zero.   * @since 1.5   */  public static final BigDecimal ZERO =     new BigDecimal (BigInteger.valueOf (0), 0);  /**   * The constant one as a BigDecimal with scale zero.   * @since 1.5   */  public static final BigDecimal ONE =     new BigDecimal (BigInteger.valueOf (1), 0);  /**   * The constant ten as a BigDecimal with scale zero.   * @since 1.5   */  public static final BigDecimal TEN =     new BigDecimal (BigInteger.valueOf (10), 0);  public static final int ROUND_UP = 0;  public static final int ROUND_DOWN = 1;  public static final int ROUND_CEILING = 2;  public static final int ROUND_FLOOR = 3;  public static final int ROUND_HALF_UP = 4;  public static final int ROUND_HALF_DOWN = 5;  public static final int ROUND_HALF_EVEN = 6;  public static final int ROUND_UNNECESSARY = 7;  public BigDecimal (BigInteger num)   {    this (num, 0);  }  public BigDecimal (BigInteger num, int scale) throws NumberFormatException   {    if (scale < 0)       throw new NumberFormatException ("scale of " + scale + " is < 0");    this.intVal = num;    this.scale = scale;  }  public BigDecimal (double num) throws NumberFormatException   {    if (Double.isInfinite (num) || Double.isNaN (num))      throw new NumberFormatException ("invalid argument: " + num);    // Note we can't convert NUM to a String and then use the    // String-based constructor.  The BigDecimal documentation makes    // it clear that the two constructors work differently.    final int mantissaBits = 52;    final int exponentBits = 11;    final long mantMask = (1L << mantissaBits) - 1;    final long expMask = (1L << exponentBits) - 1;    long bits = Double.doubleToLongBits (num);    long mantissa = bits & mantMask;    long exponent = (bits >>> mantissaBits) & expMask;    boolean denormal = exponent == 0;    // Correct the exponent for the bias.    exponent -= denormal ? 1022 : 1023;    // Now correct the exponent to account for the bits to the right    // of the decimal.    exponent -= mantissaBits;    // Ordinary numbers have an implied leading `1' bit.    if (! denormal)      mantissa |= (1L << mantissaBits);    // Shave off factors of 10.    while (exponent < 0 && (mantissa & 1) == 0)      {	++exponent;	mantissa >>= 1;      }    intVal = BigInteger.valueOf (bits < 0 ? - mantissa : mantissa);    if (exponent < 0)      {	// We have MANTISSA * 2 ^ (EXPONENT).	// Since (1/2)^N == 5^N * 10^-N we can easily convert this	// into a power of 10.	scale = (int) (- exponent);	BigInteger mult = BigInteger.valueOf (5).pow (scale);	intVal = intVal.multiply (mult);      }    else      {	intVal = intVal.shiftLeft ((int) exponent);	scale = 0;      }  }  public BigDecimal (String num) throws NumberFormatException   {    int len = num.length();    int start = 0, point = 0;    int dot = -1;    boolean negative = false;    if (num.charAt(0) == '+')      {	++start;	++point;      }    else if (num.charAt(0) == '-')      {	++start;	++point;	negative = true;      }    while (point < len)      {	char c = num.charAt (point);	if (c == '.')	  {	    if (dot >= 0)	      throw new NumberFormatException ("multiple `.'s in number");	    dot = point;	  }	else if (c == 'e' || c == 'E')	  break;	else if (Character.digit (c, 10) < 0)	  throw new NumberFormatException ("unrecognized character: " + c);	++point;      }    String val;    if (dot >= 0)      {	val = num.substring (start, dot) + num.substring (dot + 1, point);	scale = point - 1 - dot;      }    else      {	val = num.substring (start, point);	scale = 0;      }    if (val.length () == 0)      throw new NumberFormatException ("no digits seen");    if (negative)      val = "-" + val;    intVal = new BigInteger (val);    // Now parse exponent.    if (point < len)      {        point++;        if (num.charAt(point) == '+')          point++;        if (point >= len )          throw new NumberFormatException ("no exponent following e or E");	        try 	  {	    int exp = Integer.parseInt (num.substring (point));	    exp -= scale;	    if (signum () == 0)	      scale = 0;	    else if (exp > 0)	      {		intVal = intVal.multiply (BigInteger.valueOf (10).pow (exp));		scale = 0;	      }	    else	      scale = - exp;	  }        catch (NumberFormatException ex) 	  {	    throw new NumberFormatException ("malformed exponent");	  }      }  }  public static BigDecimal valueOf (long val)   {    return valueOf (val, 0);  }  public static BigDecimal valueOf (long val, int scale)     throws NumberFormatException   {    if ((scale == 0) && ((int)val == val))      switch ((int) val)	{	case 0:	  return ZERO;	case 1:	  return ONE;	}    return new BigDecimal (BigInteger.valueOf (val), scale);  }  public BigDecimal add (BigDecimal val)   {    // For addition, need to line up decimals.  Note that the movePointRight    // method cannot be used for this as it might return a BigDecimal with    // scale == 0 instead of the scale we need.    BigInteger op1 = intVal;    BigInteger op2 = val.intVal;    if (scale < val.scale)      op1 = op1.multiply (BigInteger.valueOf (10).pow (val.scale - scale));    else if (scale > val.scale)      op2 = op2.multiply (BigInteger.valueOf (10).pow (scale - val.scale));    return new BigDecimal (op1.add (op2), Math.max (scale, val.scale));  }  public BigDecimal subtract (BigDecimal val)   {    return this.add(val.negate());  }  public BigDecimal multiply (BigDecimal val)   {    return new BigDecimal (intVal.multiply (val.intVal), scale + val.scale);  }  public BigDecimal divide (BigDecimal val, int roundingMode)     throws ArithmeticException, IllegalArgumentException   {    return divide (val, scale, roundingMode);  }  public BigDecimal divide(BigDecimal val, int newScale, int roundingMode)    throws ArithmeticException, IllegalArgumentException   {    if (roundingMode < 0 || roundingMode > 7)      throw 	new IllegalArgumentException("illegal rounding mode: " + roundingMode);    if (newScale < 0)      throw new ArithmeticException ("scale is negative: " + newScale);    if (intVal.signum () == 0)	// handle special case of 0.0/0.0      return newScale == 0 ? ZERO : new BigDecimal (ZERO.intVal, newScale);        // Ensure that pow gets a non-negative value.    BigInteger valIntVal = val.intVal;    int power = newScale - (scale - val.scale);    if (power < 0)      {	// Effectively increase the scale of val to avoid an	// ArithmeticException for a negative power.        valIntVal = valIntVal.multiply (BigInteger.valueOf (10).pow (-power));	power = 0;      }    BigInteger dividend = intVal.multiply (BigInteger.valueOf (10).pow (power));        BigInteger parts[] = dividend.divideAndRemainder (valIntVal);    BigInteger unrounded = parts[0];    if (parts[1].signum () == 0) // no remainder, no rounding necessary      return new BigDecimal (unrounded, newScale);    if (roundingMode == ROUND_UNNECESSARY)      throw new ArithmeticException ("newScale is not large enough");    int sign = intVal.signum () * valIntVal.signum ();    if (roundingMode == ROUND_CEILING)      roundingMode = (sign > 0) ? ROUND_UP : ROUND_DOWN;    else if (roundingMode == ROUND_FLOOR)      roundingMode = (sign < 0) ? ROUND_UP : ROUND_DOWN;    else      {	// half is -1 if remainder*2 < positive intValue (*power), 0 if equal,	// 1 if >. This implies that the remainder to round is less than,	// equal to, or greater than half way to the next digit.	BigInteger posRemainder	  = parts[1].signum () < 0 ? parts[1].negate() : parts[1];	valIntVal = valIntVal.signum () < 0 ? valIntVal.negate () : valIntVal;	int half = posRemainder.shiftLeft(1).compareTo(valIntVal);	switch(roundingMode)	  {	  case ROUND_HALF_UP:	    roundingMode = (half < 0) ? ROUND_DOWN : ROUND_UP;	    break;	  case ROUND_HALF_DOWN:	    roundingMode = (half > 0) ? ROUND_UP : ROUND_DOWN;	    break;	  case ROUND_HALF_EVEN:	    if (half < 0)	      roundingMode = ROUND_DOWN;	    else if (half > 0)	      roundingMode = ROUND_UP;	    else if (unrounded.testBit(0)) // odd, then ROUND_HALF_UP	      roundingMode = ROUND_UP;	    else                           // even, ROUND_HALF_DOWN	      roundingMode = ROUND_DOWN;	    break;	  }      }    if (roundingMode == ROUND_UP)      unrounded = unrounded.add (BigInteger.valueOf (sign > 0 ? 1 : -1));    // roundingMode == ROUND_DOWN    return new BigDecimal (unrounded, newScale);  }      public int compareTo (BigDecimal val)   {    if (scale == val.scale)      return intVal.compareTo (val.intVal);    BigInteger thisParts[] =       intVal.divideAndRemainder (BigInteger.valueOf (10).pow (scale));    BigInteger valParts[] =      val.intVal.divideAndRemainder (BigInteger.valueOf (10).pow (val.scale));        int compare;    if ((compare = thisParts[0].compareTo (valParts[0])) != 0)      return compare;    // quotients are the same, so compare remainders    // Add some trailing zeros to the remainder with the smallest scale    if (scale < val.scale)      thisParts[1] = thisParts[1].multiply			(BigInteger.valueOf (10).pow (val.scale - scale));    else if (scale > val.scale)      valParts[1] = valParts[1].multiply			(BigInteger.valueOf (10).pow (scale - val.scale));    // and compare them    return thisParts[1].compareTo (valParts[1]);  }  public int compareTo (Object val)   {    return(compareTo((BigDecimal)val));  }  public boolean equals (Object o)   {    return (o instanceof BigDecimal 	    && scale == ((BigDecimal) o).scale	    && compareTo ((BigDecimal) o) == 0);  }  public int hashCode()   {    return intValue() ^ scale;  }  public BigDecimal max (BigDecimal val)  {    switch (compareTo (val))       {      case 1:	return this;      default:	return val;      }  }  public BigDecimal min (BigDecimal val)   {    switch (compareTo (val))       {      case -1:	return this;      default:	return val;      }  }  public BigDecimal movePointLeft (int n)  {    return (n < 0) ? movePointRight (-n) : new BigDecimal (intVal, scale + n);  }  public BigDecimal movePointRight (int n)  {    if (n < 0)      return movePointLeft (-n);    if (scale >= n)      return new BigDecimal (intVal, scale - n);    return new BigDecimal (intVal.multiply 			   (BigInteger.valueOf (10).pow (n - scale)), 0);  }  public int signum ()   {    return intVal.signum ();  }  public int scale ()   {    return scale;  }    public BigInteger unscaledValue()  {    return intVal;  }  public BigDecimal abs ()   {    return new BigDecimal (intVal.abs (), scale);  }  public BigDecimal negate ()   {    return new BigDecimal (intVal.negate (), scale);  }  public String toString ()   {    String bigStr = intVal.toString();    if (scale == 0)       return bigStr;    boolean negative = (bigStr.charAt(0) == '-');    int point = bigStr.length() - scale - (negative ? 1 : 0);    StringBuffer sb = new StringBuffer(bigStr.length() + 2 +				       (point <= 0 ? (-point + 1) : 0));    if (point <= 0)      {        if (negative)          sb.append('-');        sb.append('0').append('.');        while (point < 0)          {            sb.append('0');            point++;          }        sb.append(bigStr.substring(negative ? 1 : 0));      }    else      {	sb.append(bigStr);	sb.insert(point + (negative ? 1 : 0), '.');      }    return sb.toString();  }  public BigInteger toBigInteger ()   {    return scale == 0 ? intVal :      intVal.divide (BigInteger.valueOf (10).pow (scale));  }  public int intValue ()   {    return toBigInteger ().intValue ();  }  public long longValue ()  {    return toBigInteger().longValue();  }  public float floatValue()   {    return Float.valueOf(toString()).floatValue();  }  public double doubleValue()   {    return Double.valueOf(toString()).doubleValue();  }  public BigDecimal setScale (int scale) throws ArithmeticException  {    return setScale (scale, ROUND_UNNECESSARY);  }  public BigDecimal setScale (int scale, int roundingMode)    throws ArithmeticException, IllegalArgumentException  {    return divide (ONE, scale, roundingMode);  }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91久久国产最好的精华液| 91在线免费视频观看| 亚洲激情在线激情| 亚洲欧美在线高清| 综合激情网...| 亚洲人成网站影音先锋播放| 国产精品国产三级国产aⅴ入口| 国产日韩高清在线| 国产精品免费aⅴ片在线观看| 久久久一区二区三区捆绑**| 久久综合色8888| 久久久美女毛片| 国产精品每日更新| 亚洲另类在线制服丝袜| 亚洲成人精品一区二区| 午夜欧美大尺度福利影院在线看| 天堂一区二区在线免费观看| 日本亚洲免费观看| 激情欧美一区二区| eeuss鲁一区二区三区| 色综合久久综合中文综合网| 欧美精品久久一区二区三区| 日韩一区二区三| 日本一区二区在线不卡| 亚洲欧美日韩国产综合在线| 视频一区二区国产| 国产精品一级片| 91官网在线观看| 精品捆绑美女sm三区| 亚洲欧洲色图综合| 日本一区中文字幕| av中文字幕在线不卡| 欧美午夜精品久久久| 精品女同一区二区| 一区二区三区在线看| 日本系列欧美系列| 97精品久久久久中文字幕| 91麻豆精品国产91久久久久久久久| 日韩精品一区二区三区四区| 国产精品久久久久久久久久久免费看 | 亚洲午夜精品一区二区三区他趣| 婷婷丁香激情综合| 成人免费黄色大片| 欧美精品v日韩精品v韩国精品v| 久久亚洲一区二区三区明星换脸| 一区二区三区欧美在线观看| 国产在线日韩欧美| 69精品人人人人| 综合av第一页| 国产精品一区二区在线观看不卡 | 国产a视频精品免费观看| 91麻豆精品一区二区三区| 欧美α欧美αv大片| 亚洲伊人色欲综合网| 懂色中文一区二区在线播放| 欧美一二三在线| 亚洲午夜免费视频| 91亚洲男人天堂| 国产亚洲综合色| 久久成人免费网| 日韩三级免费观看| 偷窥少妇高潮呻吟av久久免费| 不卡一区在线观看| 国产欧美一区二区精品性色| 久久激情五月婷婷| 欧美一区二区美女| 日本不卡在线视频| 91精品国产免费久久综合| 一区二区三区精品视频在线| 91免费版pro下载短视频| 国产精品久久久久久久蜜臀| 懂色av一区二区三区免费观看| 久久综合色8888| 精品午夜一区二区三区在线观看 | 懂色av一区二区三区免费看| 久久亚洲影视婷婷| 国产精品综合久久| 国产午夜久久久久| 成人免费视频国产在线观看| www欧美成人18+| 国产一区欧美一区| 国产拍欧美日韩视频二区| 久久机这里只有精品| 欧美xxxxxxxx| 国产在线观看一区二区 | 99视频一区二区| 中文字幕欧美日本乱码一线二线| 国产黑丝在线一区二区三区| 国产日韩一级二级三级| 成人激情开心网| 一区二区国产视频| 欧美日韩亚州综合| 六月丁香综合在线视频| 久久久久国产精品人| 99久久伊人网影院| 午夜影视日本亚洲欧洲精品| 日韩午夜激情av| 国产一区二区不卡在线| 中文字幕日韩欧美一区二区三区| 在线看日本不卡| 久久精品国产秦先生| 中文字幕av一区二区三区高| 色综合av在线| 精品在线播放免费| 中文字幕一区在线观看| 欧美肥妇bbw| 国产成人精品免费网站| 亚洲网友自拍偷拍| 2021久久国产精品不只是精品| 成人网页在线观看| 丝袜亚洲精品中文字幕一区| 久久亚洲精品国产精品紫薇| 91在线小视频| 国内精品免费**视频| 亚洲五码中文字幕| 国产丝袜在线精品| 欧美剧情片在线观看| 成人涩涩免费视频| 爽爽淫人综合网网站| 国产精品久久久久国产精品日日| 8v天堂国产在线一区二区| 成人av电影免费在线播放| 免费日本视频一区| 亚洲蜜桃精久久久久久久| 2021中文字幕一区亚洲| 精品婷婷伊人一区三区三| 成人激情电影免费在线观看| 韩国女主播成人在线观看| 亚洲国产aⅴ成人精品无吗| 久久精品亚洲一区二区三区浴池| 欧美三级视频在线观看| 99综合电影在线视频| 国产成人亚洲综合a∨婷婷图片 | 久久综合久久综合九色| 欧美日韩在线免费视频| 波多野洁衣一区| 国产在线播放一区二区三区| 日本三级亚洲精品| 天天av天天翘天天综合网| 一区二区三区日韩在线观看| 亚洲欧洲av色图| 国产精品无人区| 国产亚洲成aⅴ人片在线观看| 日韩欧美国产电影| 91精品视频网| 这里只有精品电影| 制服.丝袜.亚洲.中文.综合| 欧美三级日韩三级| 欧美日韩电影在线| 欧美亚州韩日在线看免费版国语版| 91视频www| 日本韩国欧美一区| 在线观看亚洲精品| 欧美三级乱人伦电影| 欧美亚洲动漫制服丝袜| 欧美日本韩国一区二区三区视频| 欧美性xxxxx极品少妇| 欧美午夜片在线观看| 91.com在线观看| 日韩美女天天操| 久久精子c满五个校花| 日本一区二区动态图| 国产日韩欧美一区二区三区乱码 | 紧缚捆绑精品一区二区| 精品夜夜嗨av一区二区三区| 国产精品77777| 成人av在线播放网站| 在线免费一区三区| 91国偷自产一区二区三区成为亚洲经典| 一本一道久久a久久精品| 91黄视频在线观看| 欧美日韩精品一区二区三区四区| 日韩一区二区电影在线| 久久午夜老司机| 亚洲欧美日本韩国| 青青草97国产精品免费观看 | 久久精品一区八戒影视| 1024精品合集| 午夜精品福利一区二区三区av | 精品久久国产字幕高潮| 中文字幕欧美日韩一区| 亚洲韩国精品一区| 国产自产v一区二区三区c| 色悠久久久久综合欧美99| 91精品久久久久久久91蜜桃| 久久精品视频网| 亚洲精品中文在线影院| 另类成人小视频在线| 成人av网址在线| 精品视频1区2区| 国产午夜精品美女毛片视频| 亚洲视频香蕉人妖| 国产一区二区三区免费| 在线免费不卡视频| 国产偷v国产偷v亚洲高清| 亚洲自拍偷拍av| 成人午夜精品在线| 欧美白人最猛性xxxxx69交| 亚洲激情在线激情| 成人夜色视频网站在线观看|