3 ms·
The quote is talking about code that is supposed to find the ceiling of a number, and does so by adding 0.5 and then rounding to the nearest value (breaking tie
by teraflop 4y ago
The quote is talking about code that is supposed to find the ceiling of a number, and does so by adding 0.5 and then rounding to the nearest value (breaking ties by rounding towards even).
If you have a very small but non-zero positive number, it gets rounded to 0.5 after the addition, and then the second rounding incorrectly rounds toward 0 instead of 1.
The result is that you have a value x such that x > ceil(x), which shouldn't ever happen.
- bhaney 4y ago> supposed to find the ceiling Oh duh. I somehow forgot that over the span of a few sentences. Thanks.