聲明為 BigInteger 的 java.math 中的欄位 static BigInteger BigInteger. ONE BigInteger 的常量 1。 static BigInteger BigInteger. TEN BigInteger 的常量 10。 static BigInteger BigInteger. ZERO BigInteger 的常量 0。 返回 BigInteger 的 java.math 中的方法 BigInteger BigInteger. abs () 返回其值是此 BigInteger 的絕對值的 BigInteger。 BigInteger BigInteger. add (BigInteger val) 返回其值為 (this + val) 的 BigInteger。 BigInteger BigInteger. and (BigInteger val) 返回其值為 (this & val) 的 BigInteger。 BigInteger BigInteger. andNot (BigInteger val) 返回其值為 (this & ~val) 的 BigInteger。
BigInteger BigInteger. clearBit (int n) 返回其值與清除了指定位的此 BigInteger 等效的 BigInteger。
BigInteger BigInteger. divide (BigInteger val) 返回其值為 (this / val) 的 BigInteger。
BigInteger [] BigInteger. divideAndRemainder (BigInteger val) 返回包括 (this / val) 後跟 (this % val) 的兩個 BigInteger 的數組。 BigInteger BigInteger. flipBit (int n) 返回其值與對此 BigInteger 進行指定位翻轉後的值等效的 BigInteger。
BigInteger BigInteger. gcd (BigInteger val) 返回一個 BigInteger。其值是 abs(this) 和 abs(val) 的最大公約數。 BigInteger BigInteger. max (BigInteger val) 返回此 BigInteger 和 val 的最大值。 BigInteger BigInteger. min (BigInteger val) 返回此 BigInteger 和 val 的最小值。 BigInteger BigInteger. mod (BigInteger m) 返回其值為 (this mod m ) 的 BigInteger。 BigInteger BigInteger. modInverse (BigInteger m) 返回其值為 (this-1 mod m) 的 BigInteger。 BigInteger BigInteger. modPow (BigInteger exponent, BigInteger m) 返回其值為 (thisexponent mod m) 的 BigInteger。
BigInteger BigInteger. multiply (BigInteger val) 返回其值為 (this * val) 的 BigInteger。 BigInteger BigInteger. negate () 返回其值是 (-this) 的 BigInteger。
BigInteger BigInteger. nextProbablePrime () 返回大於此 BigInteger 的可能為素數的第一個整數。 BigInteger BigInteger. not () 返回其值為 (~this) 的 BigInteger。
BigInteger BigInteger. or (BigInteger val) 返回其值為 (this | val) 的 BigInteger。 BigInteger BigInteger. pow (int exponent) 返回其值為 (thisexponent ) 的 BigInteger。 static BigInteger BigInteger. probablePrime (int bitLength, Random rnd) 返回有可能是素數的、具有指定長度的正 BigInteger。 BigInteger BigInteger. remainder (BigInteger val) 返回其值為 (this % val) 的 BigInteger。 BigInteger BigInteger. setBit (int n) 返回其值與設定了指定位的此 BigInteger 等效的 BigInteger。
BigInteger BigInteger. shiftLeft (int n) 返回其值為 (this << n) 的 BigInteger。 BigInteger BigInteger. shiftRight (int n) 返回其值為 (this >> n) 的 BigInteger。 BigInteger BigInteger. subtract (BigInteger val) 返回其值為 (this - val) 的 BigInteger。 BigInteger BigDecimal. toBigInteger () 將此 BigDecimal 轉換為 BigInteger 。 BigInteger BigDecimal. toBigIntegerExact () 將此 BigDecimal 轉換為 BigInteger ,以檢查丟失的資訊。 BigInteger BigDecimal. unscaledValue () 返回其值為此 BigDecimal 的非標度值 的 BigInteger 。 static BigInteger BigInteger. valueOf (long val) 返回其值等於指定 long 的值的 BigInteger。 BigInteger BigInteger. xor (BigInteger val) 返回其值為 (this ^ val) 的 BigInteger。 參數類型為 BigInteger 的 java.math 中的方法 BigInteger BigInteger. add (BigInteger val) 返回其值為 (this + val) 的 BigInteger。 BigInteger BigInteger. and (BigInteger val) 返回其值為 (this & val) 的 BigInteger。 BigInteger BigInteger. andNot (BigInteger val) 返回其值為 (this & ~val) 的 BigInteger。 int BigInteger. compareTo (BigInteger val) 將此 BigInteger 與指定的 BigInteger 進行比較。 BigInteger BigInteger. divide (BigInteger val) 返回其值為 (this / val) 的 BigInteger。
BigInteger [] BigInteger. divideAndRemainder (BigInteger val) 返回包括 (this / val) 後跟 (this % val) 的兩個 BigInteger 的數組。 BigInteger BigInteger. gcd (BigInteger val) 返回一個 BigInteger。其值是 abs(this) 和 abs(val) 的最大公約數。
BigInteger BigInteger. max (BigInteger val) 返回此 BigInteger 和 val 的最大值。 BigInteger BigInteger. min (BigInteger val) 返回此 BigInteger 和 val 的最小值。 BigInteger BigInteger. mod (BigInteger m) 返回其值為 (this mod m ) 的 BigInteger。
BigInteger BigInteger. modInverse (BigInteger m) 返回其值為 (this-1 mod m) 的 BigInteger。 BigInteger BigInteger. modPow (BigInteger exponent, BigInteger m) 返回其值為 (thisexponent mod m) 的 BigInteger。 BigInteger BigInteger. multiply (BigInteger val) 返回其值為 (this * val) 的 BigInteger。
BigInteger BigInteger. or (BigInteger val) 返回其值為 (this | val) 的 BigInteger。 BigInteger BigInteger. remainder (BigInteger val) 返回其值為 (this % val) 的 BigInteger。 BigInteger BigInteger. subtract (BigInteger val) 返回其值為 (this - val) 的 BigInteger。 BigInteger BigInteger. xor (BigInteger val) 返回其值為 (this ^ val) 的 BigInteger。
參數類型為 BigInteger 的 java.math 中的構造方法 BigDecimal (BigInteger val) 將 BigInteger 轉換為 BigDecimal 。 BigDecimal (BigInteger unscaledVal, int scale) 將 BigInteger 非標度值和 int 標度轉換為 BigDecimal 。
BigDecimal (BigInteger unscaledVal, int scale, MathContext mc) 將 BigInteger 非標度值和 int 標度轉換為 BigDecimal (依據上下文設定進行舍入)。 BigDecimal (BigInteger val, MathContext mc) 將 BigInteger 轉換為 BigDecimal (依據上下文設定進行舍入)。 java.util 中 BigInteger 的使用 返回 BigInteger 的 java.util 中的方法 BigInteger Scanner. nextBigInteger () 將輸入資訊的下一個標記掃描為一個 BigInteger 。
BigInteger Scanner. nextBigInteger (int radix) 將輸入資訊的下一個標記掃描為一個 BigInteger 。
java.math 中 BigDecimal 的使用 聲明為 BigDecimal 的 java.math 中的欄位 static BigDecimal BigDecimal. ONE 值為 1,標度為 0。
static BigDecimal BigDecimal. TEN 值為 10,標度為 0。 static BigDecimal BigDecimal. ZERO 值為 0,標度為 0。
返回 BigDecimal 的 java.math 中的方法 BigDecimal BigDecimal. abs () 返回 BigDecimal ,其值為此 BigDecimal 的絕對值,其標度為 this.scale() 。
BigDecimal BigDecimal. abs (MathContext mc) 返回其值為此 BigDecimal 絕對值的 BigDecimal (依據上下文設定進行舍入)。 BigDecimal BigDecimal. add (BigDecimal augend) 返回一個 BigDecimal ,其值為 (this + augend) ,其標度為 max(this.scale(), augend.scale()) 。
BigDecimal BigDecimal. add (BigDecimal augend, MathContext mc) 返回其值為 (this + augend) 的 BigDecimal (依據上下文設定進行舍入)。 BigDecimal BigDecimal. divide (BigDecimal divisor) 返回一個 BigDecimal ,其值為 (this / divisor) ,其首選標度為 (this.scale() - divisor.scale()) ;假設無法表示準確的商值(由於它有無窮的十進位擴充),則拋出 ArithmeticException 。 BigDecimal BigDecimal. divide (BigDecimal divisor, int roundingMode) 返回一個 BigDecimal ,其值為 (this / divisor) ,其標度為 this.scale() 。 BigDecimal BigDecimal. divide (BigDecimal divisor, int scale, int roundingMode) 返回一個 BigDecimal 。其值為 (this / divisor) ,其標度為指定標度。
BigDecimal BigDecimal. divide (BigDecimal divisor, int scale, RoundingMode roundingMode) 返回一個 BigDecimal ,其值為 (this / divisor) ,其標度為指定標度。 BigDecimal BigDecimal. divide (BigDecimal divisor, MathContext mc) 返回其值為 (this / divisor) 的 BigDecimal (依據上下文設定進行舍入)。 BigDecimal BigDecimal. divide (BigDecimal divisor, RoundingMode roundingMode) 返回一個 BigDecimal ,其值為 (this / divisor) 。其標度為 this.scale() 。 BigDecimal [] BigDecimal. divideAndRemainder (BigDecimal divisor) 返回由兩個元素組成的 BigDecimal 數組,該數組包括 divideToIntegralValue 的結果,後跟對兩個運算元計算所得到的 remainder 。
BigDecimal [] BigDecimal. divideAndRemainder (BigDecimal divisor, MathContext mc) 返回由兩個元素組成的 BigDecimal 數組,該數組包括 divideToIntegralValue 的結果,後跟依據上下文設定對兩個運算元進行舍入計算所得到的 remainder 的結果。
BigDecimal BigDecimal. divideToIntegralValue (BigDecimal divisor) 返回 BigDecimal 。其值為向下舍入所得商值 (this / divisor) 的整數部分。 BigDecimal BigDecimal. divideToIntegralValue (BigDecimal divisor, MathContext mc) 返回 BigDecimal 。其值為 (this / divisor) 的整數部分。
BigDecimal BigDecimal. max (BigDecimal val) 返回此 BigDecimal 和 val 的最大值。 BigDecimal BigDecimal. min (BigDecimal val) 返回此 BigDecimal 和 val 的最小值。
BigDecimal BigDecimal. movePointLeft (int n) 返回一個 BigDecimal ,它等效於將該值的小數點向左移動 n 位。 BigDecimal BigDecimal. movePointRight (int n) 返回一個 BigDecimal 。它等效於將該值的小數點向右移動 n 位。
BigDecimal BigDecimal. multiply (BigDecimal multiplicand) 返回一個 BigDecimal ,其值為 (this × multiplicand) ,其標度為 (this.scale() + multiplicand.scale()) 。 BigDecimal BigDecimal. multiply (BigDecimal multiplicand, MathContext mc) 返回其值為 (this × multiplicand) 的 BigDecimal (依據上下文設定進行舍入)。
BigDecimal BigDecimal. negate () 返回 BigDecimal 。其值為 (-this) ,其標度為 this.scale() 。 BigDecimal BigDecimal. negate (MathContext mc) 返回其值為 (-this) 的 BigDecimal (依據上下文設定進行舍入)。
BigDecimal BigDecimal. plus () 返回 BigDecimal ,其值為 (+this) ,其標度為 this.scale() 。 BigDecimal BigDecimal. plus (MathContext mc) 返回其值為 (+this) 的 BigDecimal (依據上下文設定進行舍入)。 BigDecimal BigDecimal. pow (int n) 返回其值為 (thisn ) 的 BigDecimal 。準確計算該冪,使其具有無限精度。
BigDecimal BigDecimal. pow (int n, MathContext mc) 返回其值為 (thisn ) 的 BigDecimal 。
BigDecimal BigDecimal. remainder (BigDecimal divisor) 返回其值為 (this % divisor) 的 BigDecimal 。 BigDecimal BigDecimal. remainder (BigDecimal divisor, MathContext mc) 返回其值為 (this % divisor) 的 BigDecimal (依據上下文設定進行舍入)。 BigDecimal BigDecimal. round (MathContext mc) 返回依據 MathContext 設定進行舍入後的 BigDecimal 。 BigDecimal BigDecimal. scaleByPowerOfTen (int n) 返回其數值等於 (this * 10n ) 的 BigDecimal。 BigDecimal BigDecimal. setScale (int newScale) 返回一個 BigDecimal ,其標度為指定值。其值在數值上等於此 BigDecimal 的值。 BigDecimal BigDecimal. setScale (int newScale, int roundingMode) 返回一個 BigDecimal ,其標度為指定值,其非標度值通過此 BigDecimal 的非標度值乘以或除以十的適當次冪來確定。以維護其總值。 BigDecimal BigDecimal. setScale (int newScale, RoundingMode roundingMode) 返回 BigDecimal ,其標度為指定值,其非標度值通過此 BigDecimal 的非標度值乘以或除以十的適當次冪來確定。以維護其總值。 BigDecimal BigDecimal. stripTrailingZeros () 返回數值上等於此小數。但從該表示形式移除全部尾部零的 BigDecimal 。 BigDecimal BigDecimal. subtract (BigDecimal subtrahend) 返回一個 BigDecimal ,其值為 (this - subtrahend) 。其標度為 max(this.scale(), subtrahend.scale()) 。 BigDecimal BigDecimal. subtract (BigDecimal subtrahend, MathContext mc) 返回其值為 (this - subtrahend) 的 BigDecimal (依據上下文設定進行舍入)。 BigDecimal BigDecimal. ulp () 返回此 BigDecimal 的 ulp(最後一位的單位)的大小。
static BigDecimal BigDecimal. valueOf (double val) 使用 Double.toString(double) 方法提供的 double 規範的字串表示形式將 double 轉換為 BigDecimal 。
static BigDecimal BigDecimal. valueOf (long val) 將 long 值轉換為具有零標度的 BigDecimal 。 static BigDecimal BigDecimal. valueOf (long unscaledVal, int scale) 將 long 非標度值和 int 標度轉換為 BigDecimal 。 參數類型為 BigDecimal 的 java.math 中的方法 BigDecimal BigDecimal. add (BigDecimal augend) 返回一個 BigDecimal ,其值為 (this + augend) ,其標度為 max(this.scale(), augend.scale()) 。 BigDecimal BigDecimal. add (BigDecimal augend, MathContext mc) 返回其值為 (this + augend) 的 BigDecimal (依據上下文設定進行舍入)。
int BigDecimal. compareTo (BigDecimal val) 將此 BigDecimal 與指定的 BigDecimal 比較。
BigDecimal BigDecimal. divide (BigDecimal divisor) 返回一個 BigDecimal ,其值為 (this / divisor) 。其首選標度為 (this.scale() - divisor.scale()) ;假設無法表示準確的商值(由於它有無窮的十進位擴充)。則拋出 ArithmeticException 。 BigDecimal BigDecimal. divide (BigDecimal divisor, int roundingMode) 返回一個 BigDecimal ,其值為 (this / divisor) ,其標度為 this.scale() 。 BigDecimal BigDecimal. divide (BigDecimal divisor, int scale, int roundingMode) 返回一個 BigDecimal ,其值為 (this / divisor) ,其標度為指定標度。
BigDecimal BigDecimal. divide (BigDecimal divisor, int scale, RoundingMode roundingMode) 返回一個 BigDecimal 。其值為 (this / divisor) 。其標度為指定標度。 BigDecimal BigDecimal. divide (BigDecimal divisor, MathContext mc) 返回其值為 (this / divisor) 的 BigDecimal (依據上下文設定進行舍入)。 BigDecimal BigDecimal. divide (BigDecimal divisor, RoundingMode roundingMode) 返回一個 BigDecimal ,其值為 (this / divisor) ,其標度為 this.scale() 。
BigDecimal [] BigDecimal. divideAndRemainder (BigDecimal divisor) 返回由兩個元素組成的 BigDecimal 數組,該數組包括 divideToIntegralValue 的結果,後跟對兩個運算元計算所得到的 remainder 。 BigDecimal [] BigDecimal. divideAndRemainder (BigDecimal divisor, MathContext mc) 返回由兩個元素組成的 BigDecimal 數組,該數組包括 divideToIntegralValue 的結果,後跟依據上下文設定對兩個運算元進行舍入計算所得到的 remainder 的結果。
BigDecimal BigDecimal. divideToIntegralValue (BigDecimal divisor) 返回 BigDecimal ,其值為向下舍入所得商值 (this / divisor) 的整數部分。 BigDecimal BigDecimal. divideToIntegralValue (BigDecimal divisor, MathContext mc) 返回 BigDecimal ,其值為 (this / divisor) 的整數部分。
BigDecimal BigDecimal. max (BigDecimal val) 返回此 BigDecimal 和 val 的最大值。 BigDecimal BigDecimal. min (BigDecimal val) 返回此 BigDecimal 和 val 的最小值。
BigDecimal BigDecimal. multiply (BigDecimal multiplicand) 返回一個 BigDecimal 。其值為 (this × multiplicand) 。其標度為 (this.scale() + multiplicand.scale()) 。 BigDecimal BigDecimal. multiply (BigDecimal multiplicand, MathContext mc) 返回其值為 (this × multiplicand) 的 BigDecimal (依據上下文設定進行舍入)。
BigDecimal BigDecimal. remainder (BigDecimal divisor) 返回其值為 (this % divisor) 的 BigDecimal 。 BigDecimal BigDecimal. remainder (BigDecimal divisor, MathContext mc) 返回其值為 (this % divisor) 的 BigDecimal (依據上下文設定進行舍入)。
BigDecimal BigDecimal. subtract (BigDecimal subtrahend) 返回一個 BigDecimal ,其值為 (this - subtrahend) ,其標度為 max(this.scale(), subtrahend.scale()) 。 BigDecimal BigDecimal. subtract (BigDecimal subtrahend, MathContext mc) 返回其值為 (this - subtrahend) 的 BigDecimal (依據上下文設定進行舍入)。
java.util 中 BigDecimal 的使用 返回 BigDecimal 的 java.util 中的方法 BigDecimal Scanner. nextBigDecimal () 將輸入資訊的下一個標記掃描為一個 BigDecimal 。