feat(ex02): it works

This commit is contained in:
Khaïs COLIN 2025-05-14 17:17:33 +02:00
parent fce90b9a43
commit 6f17e2e888
Signed by: logistic-bot
SSH key fingerprint: SHA256:RlpiqKeXpcPFZZ4y9Ou4xi2M8OhRJovIwDlbCaMsuAo
5 changed files with 251 additions and 0 deletions

23
ex02/main.cpp Normal file
View file

@ -0,0 +1,23 @@
#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;
}