From 01b4f6f1cbff85289674ab8e5aa95ecf976bd593 Mon Sep 17 00:00:00 2001 From: Archivist Date: Thu, 2 Aug 2018 10:11:01 +0200 Subject: [PATCH] Added some safeguards against default "1" value in C++ --- include/9float.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/9float.hpp b/include/9float.hpp index 9f79038..bb1ef88 100644 --- a/include/9float.hpp +++ b/include/9float.hpp @@ -27,7 +27,7 @@ public: template constexpr Q (const srcT value) - : backend{(integer_type)(value*(1<& operator/=(const Q& oth) { - backend*=1<::degen; + backend*=((integer_type)1)<::degen; backend/=oth.backend; return *this; } @@ -145,14 +145,14 @@ public: constexpr operator float() { float n=backend; - n/=(1<::degen); + n/=(((integer_type)1)<::degen); return n; } constexpr operator double() { double n=backend; - n/=(1<::degen); + n/=(((integer_type)1)<::degen); return n; } };