পৃষ্ঠাসমূহ

Search Your Article

CS

Pageviews

Showing posts with label Java.math package classes. Show all posts
Showing posts with label Java.math package classes. Show all posts

Thursday, January 19, 2017

Java.math.BigDecimal Class

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.

Java.math.BigInteger Class

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.

Java.math.MathContext Class

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:

Java.math.RoundingMode Enumeration

Introduction

The java.math.RoundingMode enumeration specifies a rounding behavior for numerical operations capable of discarding precision. Each rounding mode indicates how the least significant returned digit of a rounded result is to be calculated.

Discuss Java.math

Java.math package provides classes for performing arbitrary-precision integer arithmetic (BigInteger) and arbitrary-precision decimal arithmetic (BigDecimal).
This reference will take you through simple and practical methods available in java.math package.