Top "Bigdecimal" questions

BigDecimal is a numeric object type in Java that represents decimal numbers with arbitrary precision.

Why does new BigDecimal("0.0").stripTrailingZeros() have a scale of 1?

Running this simple program: public static void main(final String... args) { System.out.println(BigDecimal.ZERO.scale()); System.out.println(…

java bigdecimal
Can doubles or BigDecimal overflow?

Java 8 gave us Math.addExact() for integers but not decimals. Is it possible for double and BigDecimal to overflow? Judging …

java double bigdecimal integer-overflow
Ruby BigDecimal sanity check (floating point newb)

Is my understanding correct that with Ruby BigDecimal types (even with varying precision and scale lengths) should calculate accurately or …

ruby-on-rails ruby math floating-point bigdecimal