1
0
This repository has been archived on 2025-01-26. You can view files and clone it, but cannot push or open issues or pull requests.
CPP_Module_02/ex01/main.cpp

35 lines
1.5 KiB
C++
Raw Permalink Normal View History

2024-11-19 16:31:58 +01:00
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.cpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/11/13 20:04:36 by adjoly #+# #+# */
/* Updated: 2024/11/19 12:53:28 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */
#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;
}