feat(ex02): it works
This commit is contained in:
parent
fce90b9a43
commit
6f17e2e888
5 changed files with 251 additions and 0 deletions
23
ex02/main.cpp
Normal file
23
ex02/main.cpp
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
#include "Fixed.hpp"
|
||||
#include <iostream>
|
||||
|
||||
int main(void) {
|
||||
Fixed a;
|
||||
Fixed fivedotohfive = Fixed(5.05f);
|
||||
Fixed two = Fixed(2);
|
||||
std::cout << fivedotohfive.toBin() << std::endl;
|
||||
std::cout << two.toBin() << std::endl;
|
||||
Fixed const b(fivedotohfive * two);
|
||||
std::cout << a << std::endl;
|
||||
std::cout << ++a << std::endl;
|
||||
std::cout << a << std::endl;
|
||||
std::cout << a++ << std::endl;
|
||||
std::cout << a << std::endl;
|
||||
std::cout << b << std::endl;
|
||||
std::cout << Fixed::max(a, b) << std::endl;
|
||||
std::cout << b.toBin() << std::endl;
|
||||
Fixed const c(fivedotohfive / two);
|
||||
std::cout << c << std::endl;
|
||||
std::cout << c.toBin() << std::endl;
|
||||
return 0;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue