/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
import java.math.*;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
{
BigDecimal resultDivisao
= valorInicial.
divide(contanteDivisor
);
System.
out.
println("Resultado da divisão sem arrendondamento: " + resultDivisao
);
BigDecimal resultDivisao2
= valorInicial.
divide(contanteDivisor,
new MathContext
(2, RoundingMode.
HALF_EVEN));
System.
out.
println("Resultado da divisão com arrendondamento: " + resultDivisao2
); }
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CmltcG9ydCBqYXZhLm1hdGguKjsKCi8qIE5hbWUgb2YgdGhlIGNsYXNzIGhhcyB0byBiZSAiTWFpbiIgb25seSBpZiB0aGUgY2xhc3MgaXMgcHVibGljLiAqLwpjbGFzcyBJZGVvbmUKewoJcHVibGljIHN0YXRpYyB2b2lkIG1haW4gKFN0cmluZ1tdIGFyZ3MpIHRocm93cyBqYXZhLmxhbmcuRXhjZXB0aW9uCgl7CgkJCUJpZ0RlY2ltYWwgdmFsb3JJbmljaWFsID0gbmV3IEJpZ0RlY2ltYWwoIjg0MTAiKTsKICAgICAgICAgICAgQmlnRGVjaW1hbCBjb250YW50ZURpdmlzb3IgPSBuZXcgQmlnRGVjaW1hbCgiMTAwIik7CiAgICAgICAgICAgIEJpZ0RlY2ltYWwgcmVzdWx0RGl2aXNhbyA9IHZhbG9ySW5pY2lhbC5kaXZpZGUoY29udGFudGVEaXZpc29yKTsKCiAgICAgICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbigiUmVzdWx0YWRvIGRhIGRpdmlzw6NvIHNlbSBhcnJlbmRvbmRhbWVudG86ICIgKyByZXN1bHREaXZpc2FvKTsgCiAgICAgICAgICAgIAogICAgICAgICAgICBCaWdEZWNpbWFsIHJl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