...
Code Block | ||
---|---|---|
| ||
// prints 0.1 System.out.println(new BigDecimal(""0.1"")); |
Risk Assessment
Using the BigDecimal
constructor that accepts decimal literals can lead to loss of precision.
...
FLP32-J. Range check before casting floating point numbers to narrower types 07. Floating Point (FLP) 07. Floating Point (FLP 08. Object Orientation (OBJ)