21 lines
391 B
C++
21 lines
391 B
C++
|
#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;
|
||
|
}
|