BigDecimal All Methods Introduction _object

Source: Internet
Author: User
Tags abs pow
BigDecimal
ABS ()
Returns BigDecimal with the value of the BigDecimal, whose scale is This.scale ().
BigDecimal
ABS (Mathcontext MC)
Returns the BigDecimal for this bigdecimal absolute value (rounded according to the context setting).
BigDecimal
Add (BigDecimal augend)
Returns a bigdecimal with a value of (this + augend) with a scale of Max (This.scale (), Augend.scale ()).
BigDecimal
Add (BigDecimal augend, Mathcontext MC)
Returns the BigDecimal whose value is (this + augend) (rounded according to the context setting).
Byte
Bytevalueexact ()
Convert this bigdecimal to byte to check for missing information.
Int
CompareTo (BigDecimal val)
Compares this bigdecimal to the specified bigdecimal.
BigDecimal
Divide (BigDecimal divisor)
Returns a bigdecimal with a value of (this/divisor) whose preferred scale is (This.scale ()-Divisor.scale ()), or if the exact quotient value cannot be represented (because it has an infinite decimal extension), Throws the ArithmeticException.
BigDecimal
Divide (BigDecimal divisor, int roundingmode)
Returns a bigdecimal with a value of (this/divisor) with a scale of This.scale ().
BigDecimal
Divide (BigDecimal divisor, int scale, int roundingmode)
Returns a bigdecimal with a value of (this/divisor) whose scale is the specified scale.
BigDecimal
Divide (BigDecimal divisor, int scale, Roundingmode roundingmode)

Returns a bigdecimal with a value of (this/divisor) whose scale is the specified scale.

BigDecimal
Divide (BigDecimal divisor, Mathcontext MC)
Returns the BigDecimal whose value is (this/divisor) (rounded according to the context setting).
BigDecimal
Divide (BigDecimal divisor, Roundingmode roundingmode)
Returns a bigdecimal with a value of (this/divisor) with a scale of This.scale ().
Bigdecimal[]
Divideandremainder (BigDecimal divisor)
Returns a two-element BigDecimal array that contains the results of the dividetointegralvalue followed by the remainder of the two operand calculations.
Bigdecimal[]
Divideandremainder (BigDecimal divisor, Mathcontext MC)
Returns a two-element BigDecimal array that contains the results of the dividetointegralvalue, followed by the remainder result of rounding the two operands based on the context setting.
BigDecimal
Dividetointegralvalue (BigDecimal divisor)
Returns BigDecimal, whose value is the integer portion of the quotient value (this/divisor) that is rounded down.
BigDecimal
Dividetointegralvalue (BigDecimal divisor, Mathcontext MC)
Returns the BigDecimal, whose value is the integer portion of (this/divisor).
Double
Doublevalue ()
Converts this bigdecimal to double.
Boolean
Equals (Object x)
Compares the equality of this bigdecimal with the specified object.
Float
Floatvalue () Converts this bigdecimal to float.
Int
Hashcode ()
Returns the hash code for this bigdecimal.

Int
Intvalue ()
Converts this bigdecimal to an int.
Int
Intvalueexact ()
Convert this bigdecimal to int to check for missing information.
Long
Longvalue ()
Converts this bigdecimal to long.
Long
Longvalueexact ()
Converts this bigdecimal to long to check for missing information.
BigDecimal
Max (BigDecimal val)
Returns the maximum value for this BigDecimal and Val.
BigDecimal
Min (BigDecimal val)
Returns the minimum value for this bigdecimal and Val.
BigDecimal
Movepointleft (int n)
Returns a BigDecimal, which is equivalent to moving the decimal point of the value to the left n bit.
BigDecimal
Movepointright (int n)
Returns a BigDecimal, which is equivalent to moving the decimal point of the value to the right n bit.
BigDecimal
Multiply (BigDecimal multiplicand)
Returns a bigdecimal with a value of (Thisxmultiplicand) with a scale of (This.scale () + Multiplicand.scale ()).
BigDecimal
Multiply (BigDecimal multiplicand, Mathcontext MC)
Returns the BigDecimal whose value is (Thisxmultiplicand) (rounded according to the context setting).
BigDecimal
Negate ()
Returns BigDecimal with a value of (-this) with a scale of This.scale ().
BigDecimal
Negate (Mathcontext MC)

Returns the BigDecimal whose value is (-this) (rounded according to the context setting).
BigDecimal
Plus ()
Returns BigDecimal with a value of (+this) with a scale of This.scale ().
BigDecimal
Plus (Mathcontext MC)
Returns the BigDecimal whose value is (+this) (rounded according to the context setting).
BigDecimal
Pow (int n)
Returns the BigDecimal whose value is (THISN) and accurately calculates the power so that it has infinite precision.
BigDecimal
Pow (int n, Mathcontext MC)
Returns the BigDecimal whose value is (THISN).
Int
Precision ()
Returns the precision of this bigdecimal.
BigDecimal
Remainder (BigDecimal divisor)
Returns the BigDecimal whose value is (this% divisor).
BigDecimal
Remainder (BigDecimal divisor, Mathcontext MC)
Returns the BigDecimal whose value is (this% divisor) (rounded according to the context setting).
BigDecimal
Round (Mathcontext MC)
Returns the BigDecimal after rounding based on the Mathcontext setting.
Int
Scale ()
Returns the scale of this bigdecimal.
BigDecimal
Scalebypoweroften (int n)
Returns the bigdecimal whose value is equal to (this * 10n).
BigDecimal
Setscale (int newscale)

Returns a bigdecimal whose scale is the specified value, and its value is the value of this bigdecimal.
BigDecimal
Setscale (int newscale, int roundingmode)
Returns a bigdecimal whose scale is a specified value, and its nonstandard value is determined by multiplying or dividing the bigdecimal value of the scale by the appropriate power of 10 to maintain its total value.
BigDecimal
Setscale (int newscale, Roundingmode roundingmode)
Returns BigDecimal, whose scale is the specified value, and its nonstandard value is determined by multiplying or dividing the bigdecimal value of the scale by the appropriate power of 10 to maintain its total value.
Short
Shortvalueexact ()
Convert this bigdecimal to short to check for missing information.
Int
Signum ()
Returns the positive and negative function of this bigdecimal.
BigDecimal
Striptrailingzeros ()
Returns a value that is superior to this decimal, but removes all trailing zeros from the BigDecimal.
BigDecimal
Subtract (BigDecimal subtrahend)
Returns a bigdecimal with a value of (this-subtrahend) with a scale of Max (This.scale (), Subtrahend.scale ()).
BigDecimal
Subtract (BigDecimal subtrahend, Mathcontext MC)
Returns the BigDecimal whose value is (this-subtrahend) (rounded according to the context setting).
BigInteger
Tobiginteger ()
Converts this bigdecimal to BigInteger.
BigInteger
Tobigintegerexact ()
Convert this bigdecimal to BigInteger,

String
Toengineeringstring ()
Returns the string representation of this bigdecimal, when an exponent is required, the engineering count method is used.
String
Toplainstring ()
Returns a string representation of this bigdecimal without referring to a numeric segment.
String
ToString ()
Returns the string representation of this bigdecimal, using scientific notation if an exponent is required.
BigDecimal
ULP ()
Returns the size of the ULP (last unit) of this bigdecimal.
BigInteger
Unscaledvalue ()
Returns the BigInteger of its value for the BigDecimal value for this index.
Static BigDecimal
ValueOf (double val)
Converts a double to bigdecimal by using the string representation of the double specification provided by the double.tostring (double) method.
Static BigDecimal
valueof (Long Val)
Converts a Long value to a bigdecimal with a 0 scale.
Static BigDecimal
valueof (long unscaledval, int scale)
Converts a long non-scale value and an int scale to BigDecimal.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.