Introduction to all bigdecimal Methods

Source: Internet
Author: User

Bigdecimal
ABS ()
Returns the bigdecimal value, which is the absolute value of bigdecimal and its scale is this. Scale ().
Bigdecimal
ABS (mathcontext MC)
Returns the bigdecimal value of the absolute value of bigdecimal (rounding Based on context settings ).
Bigdecimal
Add (bigdecimal augend)
Returns a bigdecimal with the value (This + augend) and the scale is max (this. Scale (), augend. Scale ()).
Bigdecimal
Add (bigdecimal augend, mathcontext MC)
Return the bigdecimal whose value is (This + augend) (round according to the context settings ).
Byte
Bytevalueexact ()
Convert bigdecimal to byte to check the lost information.
Int
Compareto (bigdecimal Val)
Compare the bigdecimal with the specified bigdecimal.
Bigdecimal
Divide (bigdecimal divisor)
Returns a bigdecimal with the value (This/divisor). The preferred scale is (this. scale ()-divisor. scale (); arithmeticexception is thrown if the exact business value cannot be expressed (because it has infinite decimal extensions.
Bigdecimal
Divide (bigdecimal divisor, int roundingmode)
Returns a bigdecimal with the value (This/divisor) and the scale is this. Scale ().
Bigdecimal
Divide (bigdecimal divisor, int scale, int roundingmode)
Returns a bigdecimal with the value (This/divisor) and the scale is the specified scale.
Bigdecimal
Divide (bigdecimal divisor, int scale, roundingmode)

Returns a bigdecimal with the value (This/divisor) and the scale is the specified scale.

Bigdecimal
Divide (bigdecimal divisor, mathcontext MC)
Returns the bigdecimal value (This/divisor) of the value (rounding according to context settings ).
Bigdecimal
Divide (bigdecimal divisor, roundingmode)
Returns a bigdecimal with the value (This/divisor) and the scale is this. Scale ().
Bigdecimal []
Divideandremainder (bigdecimal divisor)
Returns a bigdecimal array composed of two elements. This array contains the dividetointegralvalue result, followed by the remainder obtained after calculation of the two operands.
Bigdecimal []
Divideandremainder (bigdecimal divisor, mathcontext MC)
Returns a bigdecimal array composed of two elements. This array contains the dividetointegralvalue result, followed by the remainder result obtained by rounding the two operands according to the context settings.
Bigdecimal
Dividetointegralvalue (bigdecimal divisor)
Return bigdecimal, whose value is the integer part of the obtained business value (This/divisor) rounded down.
Bigdecimal
Dividetointegralvalue (bigdecimal divisor, mathcontext MC)
Returns bigdecimal, which is an integer of (This/divisor.
Double
Doublevalue ()
Convert bigdecimal to double.
Boolean
Equals (Object X)
Compare the equality between bigdecimal and the specified object.
Float
Floatvalue () converts this bigdecimal to float.
Int
Hashcode ()
Returns the bigdecimal hash code.

Int
Intvalue ()
Convert bigdecimal to int.
Int
Intvalueexact ()
Convert bigdecimal to int to check the missing information.
Long
Longvalue ()
Convert bigdecimal to long.
Long
Longvalueexact ()
Convert bigdecimal to long to check the loss of information.
Bigdecimal
Max (bigdecimal Val)
Returns the maximum values of bigdecimal and Val.
Bigdecimal
Min (bigdecimal Val)
Returns the minimum values of bigdecimal and Val.
Bigdecimal
Movepointleft (int n)
Returns a bigdecimal, which is equivalent to moving the decimal point of the value to the left.
Bigdecimal
Movepointright (int n)
Returns a bigdecimal, which is equivalent to moving the decimal point of the value to the right n places.
Bigdecimal
Multiply (bigdecimal multiplicand)
Returns a bigdecimal with the value (this × multiplicand) and the scale is (this. Scale () + multiplicand. Scale ()).
Bigdecimal
Multiply (bigdecimal multiplicand, mathcontext MC)
Return the bigdecimal value (this × multiplicand) (round according to the context settings ).
Bigdecimal
Negate ()
Returns bigdecimal with the value (-This) and its scale is this. Scale ().
Bigdecimal
Negate (mathcontext MC)

Return the bigdecimal whose value is (-This) (round according to the context settings ).
Bigdecimal
Plus ()
Returns bigdecimal with the value (+ This) and the scale is this. Scale ().
Bigdecimal
Plus (mathcontext MC)
Return the bigdecimal whose value is (+ This) (round according to the context settings ).
Bigdecimal
Pow (int n)
Return the bigdecimal whose value is (thisn) to accurately calculate the power, so that it has infinite precision.
Bigdecimal
Pow (int n, mathcontext MC)
Returns the bigdecimal value of (thisn.
Int
Precision ()
Returns the precision of bigdecimal.
Bigdecimal
Remainder (bigdecimal divisor)
Returns the bigdecimal value of this % divisor.
Bigdecimal
Remainder (bigdecimal divisor, mathcontext MC)
Returns the bigdecimal value (this % divisor) of the value (rounding according to context settings ).
Bigdecimal
Round (mathcontext MC)
Return the bigdecimal after rounding according to the mathcontext settings.
Int
Scale ()
Returns the scale of the bigdecimal.
Bigdecimal
Scalebypoweroften (int n)
Returns the bigdecimal whose value is equal to (this * 10n.
Bigdecimal
Setscale (INT newscale)

Returns a bigdecimal with the specified scale. Its value is equal to the bigdecimal value.
Bigdecimal
Setscale (INT newscale, int roundingmode)
Return a bigdecimal value whose scale is the specified value. The nonstandard value is determined by multiplying or dividing the nonstandard value of bigdecimal by the appropriate power of 10 to maintain its total value.
Bigdecimal
Setscale (INT newscale, roundingmode)
Bigdecimal is returned, and its scale is a specified value. Its nonstandard degree value is determined by multiplying the nonstandard degree value of bigdecimal by or dividing by the appropriate power of 10 to maintain its total value.
Short
Shortvalueexact ()
Convert bigdecimal to short to check the loss of information.
Int
SIGNUM ()
Returns the positive and negative functions of bigdecimal.
Bigdecimal
Striptrailingzeros ()
Returns a number equal to this decimal number, but removes all bigdecimal values with zero tails from this representation.
Bigdecimal
Subtract (bigdecimal subtrahend)
Returns a bigdecimal with the value (this-subtrahend) and its scale is max (this. Scale (), subtrahend. Scale ()).
Bigdecimal
Subtract (bigdecimal subtrahend, mathcontext MC)
Return the bigdecimal value (this-subtrahend) of the class (round according to the context settings ).
Biginteger
Tobiginteger ()
Convert bigdecimal to biginteger.
Biginteger
Tobigintegerexact ()
Convert bigdecimal to biginteger,

String
Toengineeringstring ()
Returns the string representation of this bigdecimal type. When an index is required, the engineering notation is used.
String
Toplainstring ()
Returns the string representation of this bigdecimal without an exponential field.
String
Tostring ()
Returns the string representation of this bigdecimal type. If an index is required, scientific notation is used.
Bigdecimal
ULP ()
Returns the size of the bigdecimal ULP (Unit of the last digit.
Biginteger
Unscaledvalue ()
Return the biginteger of the non-standard degree of the bigdecimal value.
Static bigdecimal
Valueof (double Val)
Use the double standard string representation provided by the double. tostring (double) method to convert double to bigdecimal.
Static bigdecimal
Valueof (long Val)
Converts a long value to a bigdecimal with a zero scale.
Static bigdecimal
Valueof (long unscaledval, int scale)
Convert the long non-standard degree value and 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.