
i
i
“K23166” — 2015/1/28 — 9:35 — page 38 — #64
i
i
i
i
i
i
38 CHAPTER 3. STATISTICAL AND MATHEMATICAL FUNCTIONS
Note: The second parameter of the round() function determines how many decimal places
to round. The value of movetozero is the same as justint if x > 0 or nextint if x < 0.
3.2.5 Comparisons of floating-point variables
Because certain floating-point values of variables do not have exact decimal equivalents,
there may be some error in how they are represented on a computer. For example, if the
true value of a particular variable is 1/7, the approximate decimal is 0.1428571428571428.
For some operations (for example, tests of equality), this approximation ...