Skip to content

Latest commit

History

History
50 lines (39 loc) 路 1.02 KB

README.markdown

File metadata and controls

50 lines (39 loc) 路 1.02 KB

libbin

Definitions and implementations of bitwise, numerical, and logical operations.

Rules and Restrictions

The only operators allowed from the C language are &&, ||, and !.

To implement logic, check bit truthiness and/or use functions that do the same.

Use only the type bin as defined in ./src/16.h.

You may not convert between bases.

Write unit tests for new features.

Exceptions

  • Minor exceptions to these rules will be allowed to create simple loops.
  • You may use + and - to adjust for array indexing.

Objectives

Implement operators from the following categories:

  1. Bitwise
    • NOT
    • AND
    • OR
    • XOR
    • Most significant bit
    • Least significant bit
    • Shift left and right
    • Rotate left and right
  2. Math
    • Add
    • Subtract
    • Multiply
    • Divide
    • Modulus
    • Exponentiate
    • Logarithm
  3. Boolean
    • Equality
    • Greater than
    • Less than
    • Greater than or equal to
    • Less than or equal to
    • Negation
    • Conjuction
    • Disjunction