Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 25 Feb 2018 19:29:55 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 217149] seq(1) inconsistently omits 'last' when using float increment
Message-ID:  <bug-217149-8-bQutK0P7tJ@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-217149-8@https.bugs.freebsd.org/bugzilla/>
References:  <bug-217149-8@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D217149

--- Comment #14 from Conrad Meyer <cem@freebsd.org> ---
(In reply to fernando.apesteguia from comment #12)
> cur >=3D 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.

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-217149-8-bQutK0P7tJ>