mirror of
https://github.com/kenhuangus/wikiskill
synced 2026-09-22 23:34:25 +08:00
11 lines
202 B
Markdown
11 lines
202 B
Markdown
# Pattern: Rounding errors
|
|
|
|
## Description
|
|
Demo pattern: naive rounding gives wrong answers.
|
|
|
|
## Root cause
|
|
Skipping the final rounding step.
|
|
|
|
## Workaround
|
|
Always round the final result to 2 decimals.
|