diff options
Diffstat (limited to 'Userland/Applications/Calculator/Calculator.h')
-rw-r--r-- | Userland/Applications/Calculator/Calculator.h | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/Userland/Applications/Calculator/Calculator.h b/Userland/Applications/Calculator/Calculator.h index bbfcac5546..5d995bf7e1 100644 --- a/Userland/Applications/Calculator/Calculator.h +++ b/Userland/Applications/Calculator/Calculator.h @@ -7,7 +7,7 @@ #pragma once -#include "KeypadValue.h" +#include <LibCrypto/BigFraction/BigFraction.h> // This type implements the regular calculator // behavior, such as performing arithmetic @@ -39,8 +39,8 @@ public: MemAdd }; - KeypadValue begin_operation(Operation, KeypadValue); - KeypadValue finish_operation(KeypadValue); + Crypto::BigFraction begin_operation(Operation, Crypto::BigFraction); + Crypto::BigFraction finish_operation(Crypto::BigFraction); bool has_error() const { return m_has_error; } @@ -48,24 +48,8 @@ public: void clear_error() { m_has_error = false; } private: - static bool should_be_rounded(KeypadValue); - static void round(KeypadValue&); - - static constexpr auto rounding_threshold = []() consteval - { - using used_type = u64; - - auto count = 1; - used_type res = 10; - while (!__builtin_mul_overflow(res, (used_type)10, &res)) { - count++; - } - return count; - } - (); - Operation m_operation_in_progress { Operation::None }; - KeypadValue m_saved_argument { (i64)0 }; - KeypadValue m_mem { (i64)0 }; + Crypto::BigFraction m_saved_argument {}; + Crypto::BigFraction m_mem {}; bool m_has_error { false }; }; |