[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: inequality
- From: spir <denis.spir@...>
- Date: Tue, 26 Jan 2010 15:02:04 +0100
On Tue, 26 Jan 2010 15:02:40 +0200
steve donovan <email@example.com> wrote:
> On Tue, Jan 26, 2010 at 2:58 PM, spir <firstname.lastname@example.org> wrote:
> > -- common other choice
> > MAX = ...
> > if n < MAX+1
> But why do an extra operation? This alone would make the first one
> better (it expresses the condition more clearly)
Well, this form avoids comparing for equality in addition to inequality. (But I have no idea how much more costly <= is compared to <.)
I fully agree with "it expresses the condition more clearly". This is the relevant reason for me to choose "if n <= MAX".
> steve d.
la vita e estrany