Numbers

version 1 by Jeremy John Reeder

  • Home page
  • Beginning
  • Previous
  • Next



  • Part 2 - Testing
    Divisibility relates a number (called A) to a number (called B) when the remainder after dividing A by B is zero.
    The verb to divide (he divides, they divide, he divided, it is divisible) implies the reversed divisibility relation.
    To decide whether (N - an arithmetic value of kind K) is between (A - K) and (B - K):
        if A is greater than B, decide on whether or not N is between B and A;
        if N is less than A, no;
        if N is greater than B, no;
        yes.
    To decide whether (N - an arithmetic value of kind K) is not between (A - K) and (B - K):
        if A is greater than B, decide on whether or not N is not between B and A;
        if N is less than A, yes;
        if N is greater than B, yes;
        no.