ADDITIONAL SYSTEM INFORMATION :
Also tested OpenJDK 11.0.2 with the same result.
A DESCRIPTION OF THE PROBLEM :
The method java.math.BigDecimal.sqrt(MathContext mc) does not respect the intention of RoundingMode.FLOOR.
Other RoundingMode values have not been tested, but may also return incorrectly rounded results.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Execute the simple source code snippet in a main method.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
1.99999999999
ACTUAL -
2.00000000000
---------- BEGIN SOURCE ----------
MathContext mc = new MathContext(12, RoundingMode.FLOOR);
System.out.println(new BigDecimal("3.999999999999999999999999999999").sqrt(mc));
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Using the sqrt() method of the bigmath library from https://github.com/eobermuhlner/big-math does deliver the correct result.
FREQUENCY : always