Reputation: 4642
I am reading David Goldberg's "What Every Computer Scientist Must Know About Floating Point Numbers" and came across the section on ULPs. He gives an example:
Actual result : 0.0314 = 3.14 x 10 -2
Closest FP no: 3.12 x 10 -2
So, ULP = (3.14 - 3.12) x 10 2 = 2
However, I am not able to develop an intuition of what this actually means and need some help. What does 'units' mean here?
Upvotes: 1
Views: 496
Reputation: 223702
The question appears to refer to this passage in What Every Computer Scientist Should Know About Floating-Point Arithmetic:
Consider the floating-point format with β = 10 and p = 3, which will be used throughout this section. If the result of a floating-point computation is 3.12 × 10-2, and the answer when computed to infinite precision is .0314, it is clear that this is in error by 2 units in the last place.
There are differences between this passage and that given in the question:
Given β = 10 and p = 3, the format uses significands of three decimal digits. The ULP, Unit of Least Precision, is simply the position value of the least significant digit. So, for the number .0312, the ULP is .0001. This passage in Goldberg observes that the difference between .0314 and .0312 is 2 ULP.
Upvotes: 4