The Java.math.BigDecimal class provides arithmetic, scale operations, rounding, comparison, hashing algorithms, and format conversion operations.The ToString () method provides a canonical representation of the BigDecimal. It gives the user full
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
BigdecimalABS ()Returns the bigdecimal value, which is the absolute value of bigdecimal and its scale is this. Scale ().BigdecimalABS (mathcontext MC)Returns the bigdecimal value of the absolute value of bigdecimal (rounding Based on context
BigDecimal How to useBlog Category:
Java Basics
The Bigdecimalmultiplyadddivide BigDecimal consists of an integer non-scaling value of arbitrary precision and a 32-bit integer scale (scales). If zero or positive, the scale is the number
Java BigDecimal, javabigdecimal
Java provides operation classes for big numbers, namely java. math. BinInteger and java. math. BigDecimal. These two classes are used for high-precision computing. The BigInteger class is a processing class for large
In Java, double to BigDecimal is often used, and Division operations are often performed. However, you need to be especially careful with the following usage.
Java codePackage com. ccxe. number;Import java. math. BigDecimal;Import java. math.
The field in Java.math declared as BigInteger is static BigInteger BigInteger. The one BigInteger constant 1. Static BigInteger BigInteger. TEN BigInteger's constant 10. Static BigInteger BigInteger. The constant of ZERO BigInteger 0.Returns the
Why use bigdecimal?borrowing the Effactive Javain this book,the main design goals forfloat and double types are for scientific calculations and engineering calculations. They perform binary floating-point operations, which are designed to provide
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.