On Mar 18, 12:15 pm, Andrew Haley <andre...@[EMAIL PROTECTED]
>
wrote:
> Jerry Avins <j...@[EMAIL PROTECTED]
> wrote:
> > Andrew Haley wrote:
> >> Jerry Avins <j...@[EMAIL PROTECTED]
> wrote:
> >>> Andrew Haley wrote:
>
> >>> ...
>
> >>>> Most people are more familiar with the number line than the number
> >>>> circle, but in practice computer arithmetic tends to behave more
like
> >>>> a number circle. Most Forth comparison operators use the number
line.
>
> >>> Other comparison operators take two arguments. Between differs in
that
> >>> it takes three.
>
> >> Yea, that's true, but I don't really see your point. It's quite
> >> possible to write circular versions of the two-operand comparison
> >> operators, but that's not standard.
> > I don't see how offhand. Doesn't it take two limit operands to
establish
> > direction? With one-operand limits, the direction has to be assumed.
>
> A circular < is simply
>
> - 0<
>
> It's just like a phase angle: a b - 0< returns true iff a lags behind
> b.
Actually, a circular < is simply
: Circular< ( a b -- flag ) <> ;
Its modulus arithmetic, a number is both less than and greater than
every number other than itself, because numbers wrap around, with the
largest being just less than the smallest and the smallest just
greater than the largest.


|