main.cpp 1.5 KB

123456789101112131415161718192021222324252627282930313233
  1. /* ************************************************************************** */
  2. /* */
  3. /* ::: :::::::: */
  4. /* main.cpp :+: :+: :+: */
  5. /* +:+ +:+ +:+ */
  6. /* By: bchanot <bchanot@gmail.fr> +#+ +:+ +#+ */
  7. /* +#+#+#+#+#+ +#+ */
  8. /* Created: 2025/07/17 15:10:40 by bchanot #+# #+# */
  9. /* Updated: 2025/07/17 17:36:23 by bchanot ### ########.fr */
  10. /* */
  11. /* ************************************************************************** */
  12. #include "Fixed.class.hpp"
  13. #include <iostream>
  14. int main( void ) {
  15. Fixed a;
  16. Fixed const b( 10 );
  17. Fixed const c( 42.42f );
  18. Fixed const d( b );
  19. a = Fixed( 1234.4321f );
  20. std::cout << "a is " << a << std::endl;
  21. std::cout << "b is " << b << std::endl;
  22. std::cout << "c is " << c << std::endl;
  23. std::cout << "d is " << d << std::endl;
  24. std::cout << "a is " << a.toInt() << " as integer" << std::endl;
  25. std::cout << "b is " << b.toInt() << " as integer" << std::endl;
  26. std::cout << "c is " << c.toInt() << " as integer" << std::endl;
  27. std::cout << "d is " << d.toInt() << " as integer" << std::endl;
  28. return 0;
  29. }