Data Type For Precise Decimal Arithmetic
A banking application needs to represent account balances, such as $1,234.56. The application must perform calculations, like computing interest, that require exact decimal arithmetic to avoid rounding errors. Which data type is most appropriate for storing these balances?
A
BigDecimal (reference type)
B
int
C
boolean
D
double
Question Leaderboard
| Rank | |||||
|---|---|---|---|---|---|
| #1 | kaisuki | 1 | 1 | 0m 00s | 100 |
| #2 | lsj08030922 | 1 | 1 | 0m 12s | 88 |
| #3 | liuwilliam072410 | 1 | 2 | 0m 23s | 67 |
| #4 | chunxiangxu.cxu | 0 | 1 | 0m 18s | -28 |
| #5 | richa.tuli | 0 | 2 | 2m 35s | -175 |
| #6 | bommasam000 | 2 | 6 | 7m 00s | -260 |
| #7 | zgj07310417 | 3 | 4 | 22m 50s | -1,080 |
Items per page:
10
1 – 7 of 7
APFIVE