I have two a cyclic integer, modulo 16, so they assume values between 0 and 15.
I need to compare two numbers to determine if n_1
is greater than n_0
n_1 > n_0
Obviously, this is not exactly defined, so I define n_1
to be greater than n_0
if it is less than 8 "numbers" ahead, otherwise, it is lesser than n_0
(if not equal).
I.e. if:
n_0 = 0
if n_1 is between 1 and 8 (both inclusive)
then n_1 is greater than n_0.
n_0 = 5
if n_1 is between 6 and 15 (both inclusive)
then n_1 is greater than n_0.
n_0 = 12
if n_1 is between 13 and 15 (both inclusive)
or between 0 and 4 (both inclusive)
then n_1 is greater than n_0.
How do I express this comparison programatically?
I am sure I am confusing the terminology above, so please feel free to correct my wording. :)