fix: patching the ex01 of the module 02

This commit is contained in:
Raphael 2024-12-27 13:12:44 +01:00
parent 2d6b2ddb83
commit 95fb804997
5 changed files with 269 additions and 0 deletions

30
cpp02/ex01/main.cpp Normal file
View file

@ -0,0 +1,30 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.cpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/12/23 14:41:58 by rparodi #+# #+# */
/* Updated: 2024/12/27 13:11:37 by rparodi ### ########.fr */
/* */
/* ************************************************************************** */
#include "Fixed.hpp"
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;
}