Java introduction to BigDecimal

BigDecimal represent immutable, arbitrary-precision signed decimal numbers. A BigDecimal consists of an arbitrary precision integer unscaled value and a 32-bit integer scale. The BigDecimal class provides operations for arithmetic, scale manipulation, rounding, comparison, hashing, and format conversion. The toString() method provides a canonical representation of a BigDecimal. Why we need BigDecimal? We already have double, … Read more

Java Quadratic equation solution

In algebra, a quadratic equation (from Latin quadratus ‘square‘) is any equation that can be rearranged in standard form as: ax2 + bx + c = 0 This java program will try to find the roots of this quadratic equation based on the parameters a, b and c. This parameters are required to be given as input from the console and then … Read more