Truncation
A Programming Pattern |
Prof. David Bernstein
|
Computer Science Department |
bernstdh@jmu.edu |
526
pieces is 526 / 10
or
52
batchesplace
denotes the place to truncate to
(10
for the 10s place, 100
for the
100s places, etc...)number
denotes the original number((1996 + 87) / 10) * 10
or 2080
((1996 + 87) / 100) * 100
or 2000
(a / b) * b
does not equal
a