You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1.6 KiB

3 years ago
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.cpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: narnaud <narnaud@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/06/20 10:07:23 by narnaud #+# #+# */
2 years ago
/* Updated: 2022/07/18 13:51:53 by narnaud ### ########.fr */
3 years ago
/* */
/* ************************************************************************** */
#include "Fixed.hpp"
int main(void)
{
Fixed a;
Fixed const b( 10 );
Fixed const c( 42.42f );
Fixed const d( b );
2 years ago
//Fixed e;
//e = d;
3 years ago
a = Fixed( 1234.4321f );
2 years ago
//std::cout << a.getRawBits() << std::endl;
//std::cout << b.getRawBits() << std::endl;
//std::cout << c.getRawBits() << std::endl;
3 years ago
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;
}