Category: 16. Java.math package

  • MathContext 

    Introduction The java.math.MathContext class provides immutable objects which encapsulate the context settings and describes certain rules for numerical operators, such as those implemented by the BigDecimal class. The base-independent settings are − Class declaration Following is the declaration for java.math.MathContext class − Learn Java in-depth with real-world projects through our Java certification course. Enroll and become a certified expert to boost your…

  • BigInteger 

    Introduction The java.math.BigInteger class provides operations analogues to all of Java’s primitive integer operators and for all relevant methods from java.lang.Math. It also provides operations for modular arithmetic, GCD calculation, primality testing, prime generation, bit manipulation, and a few other miscellaneous operations. All operations behave as if BigIntegers were represented in two’s-complement notation. Semantics of arithmetic operations…

  • BigDecimal 

    Introduction The java.math.BigDecimal class provides operations for arithmetic, scale manipulation, rounding, comparison, hashing, and format conversion. The toString() method provides a canonical representation of a BigDecimal. It gives the user complete control over rounding behavior. Two types of operations are provided for manipulating the scale of a BigDecimal − This class and its iterator implement all of…