aboutsummaryrefslogtreecommitdiff
path: root/cpp02/ex01/Fixed.hpp
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2020-10-19 11:30:22 +0200
committerCharles Cabergs <me@cacharle.xyz>2020-10-19 11:30:22 +0200
commita3ff15046fa3d367ff7304dc9482e81597eb76b9 (patch)
treef3c02121bd166dbbeab83653ca9d0ba360eb8478 /cpp02/ex01/Fixed.hpp
parent52a866baba3cbb05ecf0be88f1b50991b4a26b52 (diff)
downloadpiscine_cpp-a3ff15046fa3d367ff7304dc9482e81597eb76b9.tar.gz
piscine_cpp-a3ff15046fa3d367ff7304dc9482e81597eb76b9.tar.bz2
piscine_cpp-a3ff15046fa3d367ff7304dc9482e81597eb76b9.zip
Fixing cpp02/ex01 float/fixed conversions
Diffstat (limited to 'cpp02/ex01/Fixed.hpp')
-rw-r--r--cpp02/ex01/Fixed.hpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/cpp02/ex01/Fixed.hpp b/cpp02/ex01/Fixed.hpp
index 2dd2d7d..726b810 100644
--- a/cpp02/ex01/Fixed.hpp
+++ b/cpp02/ex01/Fixed.hpp
@@ -6,7 +6,7 @@
/* By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/04/13 11:40:49 by charles #+# #+# */
-/* Updated: 2020/04/13 12:58:33 by charles ### ########.fr */
+/* Updated: 2020/10/19 11:29:30 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
@@ -14,6 +14,7 @@
# define FIXED_HPP
# include <iostream>
+# include <cmath>
class Fixed
{
@@ -23,14 +24,14 @@ public:
~Fixed();
void operator=(Fixed const& other);
- Fixed(int from);
- Fixed(float from);
+ Fixed(const int from);
+ Fixed(const float from);
- int getRawBits() const;
+ int getRawBits() const;
void setRawBits(int const raw);
float toFloat() const;
- int toInt() const;
+ int toInt() const;
static int getFractionalBits();