Numbers

version 1 by Jeremy John Reeder

  • Home page
  • Beginning
  • Previous
  • Next



  • Part 1 - Arithmetic
    To multiply (A - an existing number variable) by (B - a number):
        (- {A} = {A} * {B}; -).
    To divide (A - an existing number variable) by (B - a number):
        (- {A} = IntegerDivide({A}, {B}); -).
    To decide what number is the negative of (N - a number): decide on zero minus N.
    To decide what number is the sign of (N - a number):
        if N is positive:
            decide on 1;
        otherwise if N is negative:
            decide on -1;
        otherwise:
            decide on 0.
    To decide what K is the difference between (A - an arithmetic value of kind K) and (B - K):
        if A is greater than B:
            decide on A minus B;
        otherwise:
            decide on B minus A.
    To decide which number is (B - a number) raised to the power of (E - a number):
        let the answer be 1;
        while E > 0:
            multiply the answer by B;
            decrease E by 1;
        decide on the answer.