...
Using the BigDecimal(double val) constructor with decimal floating-point literals can lead to loss of precision.
Rule | Severity | Likelihood | Remediation Cost | Priority | Level |
|---|---|---|---|---|---|
NUM10-J | Low | Probable | Low | P6 | L2 |
Automated Detection
Automated detection is straightforward.
| Tool | Version | Checker | Description | ||||||
|---|---|---|---|---|---|---|---|---|---|
| Parasoft Jtest |
| PB.NUM.BBDCC | Implemented | ||||||
| SonarQube |
| S2111 |
| "BigDecimal(double)" should not be used |
Bibliography
...
...