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

View File

@@ -3,39 +3,22 @@
int main( void ) {
// Fixed a(1105979538);
Fixed a(1105979);
std::cout << '\n';
Fixed b(1000.5979f);
std::cout << '\n';
Fixed c(-1105.979f);
std::cout << '\n';
Fixed d(3726.7623683f);
std::cout << '\n';
Fixed e(4328239.384271721f);
std::cout << '\n';
Fixed f(1.11117f);
std::cout << '\n';
Fixed g(42.42f);
std::cout << '\n';
Fixed h(1234.4321f);
Fixed a;
Fixed const b( 10 );
Fixed const c( 42.42f );
Fixed const d( b );
// 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;
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;
}