cpp02/ex02/main.cpp

23 lines
659 B
C++

#include "Fixed.hpp"
#include <iostream>
int main(void) {
Fixed a;
Fixed fivedotohfive = Fixed(5.05f);
Fixed two = Fixed(2);
std::cout << fivedotohfive.toBin() << std::endl;
std::cout << two.toBin() << std::endl;
Fixed const b(fivedotohfive * two);
std::cout << a << std::endl;
std::cout << ++a << std::endl;
std::cout << a << std::endl;
std::cout << a++ << std::endl;
std::cout << a << std::endl;
std::cout << b << std::endl;
std::cout << Fixed::max(a, b) << std::endl;
std::cout << b.toBin() << std::endl;
Fixed const c(fivedotohfive / two);
std::cout << c << std::endl;
std::cout << c.toBin() << std::endl;
return 0;
}