creation d02 ex02

This commit is contained in:
hugogogo
2022-02-14 21:06:36 +01:00
parent 9036ded700
commit b08663e74e
9 changed files with 310 additions and 81 deletions

24
d02/ex02/main.cpp Normal file
View File

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