Skip to content

An implementation of basic functions (e.g. addition) in C++ in which only bitwise operations are allowed.

License

Notifications You must be signed in to change notification settings

NumericalMax/bitwise-bao

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 

Repository files navigation

Basic arithmetic operations (bao) implemented with bitwise operators

This is an implementation of basic arithmetic functions (e.g. plus, minus) in C++ in which only bitwise operators are allowed. It is solely designed for the datatype integer.

+

Summation of two integers a and b: a + b

-

Subtraction of two integers a and b: a - b

*

Multiplication of two integers a and b: a * b

/

Division of two integers a and b without rest: a / b

How to execute in the terminal:

git clone https://github.com/NumericalMax/bitwise-bao.git
cd bitwise-bao
g++ main.cpp -o main
./main

The program will ask you for three parameters:

  1. a = First Number
  2. b = Second Number
  3. n = Number of computations performed for each basic algorithmic operation. You can set this parameter to 1, unless you want to perform time measurement. In the latter case large n will result in more stable time measurements.

About

An implementation of basic functions (e.g. addition) in C++ in which only bitwise operations are allowed.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages