Functional NegBin implementaion
This commit is contained in:
commit
82c2bb9f1b
9 changed files with 332 additions and 0 deletions
20
NegBin/main.cpp
Normal file
20
NegBin/main.cpp
Normal file
|
@ -0,0 +1,20 @@
|
|||
#include <iostream>
|
||||
#include "NegBin.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
NegBin a = 0b11011_nb;
|
||||
NegBin b = 0b10010_nb;
|
||||
|
||||
std::cout << a << "-" << b << " = " << a-b << std::endl;
|
||||
std::cout << a << "*" << 5 << " = " << a*5 << std::endl;
|
||||
|
||||
auto c = NegBin(6);
|
||||
auto d = NegBin(-12);
|
||||
|
||||
std::cout << "6 is " << c << std::endl;
|
||||
std::cout << "-12 is " << d << std::endl;
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue