37 lines
807 B
C++
37 lines
807 B
C++
#include "Fixed.hpp"
|
|
|
|
int main() {
|
|
|
|
{
|
|
Fixed a;
|
|
a.setRawBits(2);
|
|
Fixed b( a );
|
|
Fixed c;
|
|
|
|
c = b;
|
|
|
|
std::cout << " a:" << a.getRawBits() << std::endl;
|
|
std::cout << " b:" << b.getRawBits() << std::endl;
|
|
std::cout << " c:" << c.getRawBits() << std::endl;
|
|
}
|
|
|
|
std::cout << "---------------------" << std::endl;
|
|
|
|
{
|
|
Fixed a;
|
|
a.setRawBits(5);
|
|
std::cout << " a:" << a.getRawBits() << std::endl;
|
|
Fixed b(a);
|
|
std::cout << " a:" << a.getRawBits() << std::endl;
|
|
std::cout << " b:" << b.getRawBits() << std::endl;
|
|
a.setRawBits(12);
|
|
std::cout << " a:" << a.getRawBits() << std::endl;
|
|
std::cout << " b:" << b.getRawBits() << std::endl;
|
|
b.setRawBits(2);
|
|
std::cout << " a:" << a.getRawBits() << std::endl;
|
|
std::cout << " b:" << b.getRawBits() << std::endl;
|
|
}
|
|
|
|
return 0;
|
|
}
|