feat(ex01): it works

This commit is contained in:
Khaïs COLIN 2025-05-14 13:43:07 +02:00
parent baadd5bddc
commit fce90b9a43
Signed by: logistic-bot
SSH key fingerprint: SHA256:RlpiqKeXpcPFZZ4y9Ou4xi2M8OhRJovIwDlbCaMsuAo
5 changed files with 163 additions and 0 deletions

23
ex01/main.cpp Normal file
View file

@ -0,0 +1,23 @@
#include "Fixed.hpp"
#include <iostream>
int main(void) {
Fixed a;
Fixed const b(10);
Fixed const c(42.42f);
Fixed const d(b);
a = Fixed(1234.4321f);
std::cout << "a is " << a << std::endl;
std::cout << "b is " << b << std::endl;
std::cout << "c is " << c << std::endl;
std::cout << "d is " << d << std::endl;
std::cout << "a is " << a.toInt() << " as integer" << std::endl;
std::cout << "b is " << b.toInt() << " as integer" << std::endl;
std::cout << "c is " << c.toInt() << " as integer" << std::endl;
std::cout << "d is " << d.toInt() << " as integer" << std::endl;
std::cout << "a is " << a.toBin() << " as binary" << std::endl;
std::cout << "b is " << b.toBin() << " as binary" << std::endl;
std::cout << "c is " << c.toBin() << " as binary" << std::endl;
std::cout << "d is " << d.toBin() << " as binary" << std::endl;
return 0;
}