Content-Length: 250699 | pFad | http://github.com/seigtm/BitwiseAddition

88 GitHub - seigtm/BitwiseAddition: Addition of two integers using only bitwise operators (C++).
Skip to content
This repository was archived by the owner on Feb 22, 2024. It is now read-only.

seigtm/BitwiseAddition

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

BitwiseAddition

Addition of two integers using only bitwise operators (C++).

/**
  Bitwise sum function for two integers.
  @param first an integer argument, first summand
  @param second an integer argument, second summand
  @return The sum of a and b (integer)
*/
int bitwise_sum(int first = 0, int second = 0);

Usage example

std::cout << bitwise_sum(3, 5)        // Output: 8.
          << bitwise_sum(0, 0)        // Output: 0.
          << bitwise_sum(5000, 3000)  // Output: 8000.
          << bitwise_sum(171, 13)     // Output: 184.
          << bitwise_sum(788, 131);   // Output: 919.








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/seigtm/BitwiseAddition

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy