[Bug 217149] seq(1) inconsistently omits 'last' when using float increment

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sun Feb 25 19:29:57 UTC 2018


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=217149

--- Comment #14 from Conrad Meyer <cem at freebsd.org> ---
(In reply to fernando.apesteguia from comment #12)
> cur >= last - (incr / 2);

This one should also be plus.

> The problem with this one is that in some cases, we are not stopping when we should.

Ah, the problem is that 'last' is not a multiple of 'incr'.  Hmm.  Maybe the
terminating math should be: 'trunc(last / incr) * incr + (incr / 2)'.  That is,
round down 'last' to a multiple of 'incr' and then add the epsilon ('incr/2').

That is a little unwieldy for the for loop, of course, but the math can be
moved out.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list