cpp/CPP02/ex01/main.cpp
2024-12-04 17:29:31 +01:00

26 lines
808 B
C++

#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;
std::cout << "-------------------------" << std::endl;
std::cout << "a is " << a.getRawBits() << std::endl;
std::cout << "b is " << b.getRawBits() << std::endl;
std::cout << "c is " << c.getRawBits() << std::endl;
return 0;
}