diff options
Diffstat (limited to 'number.cpp')
-rw-r--r-- | number.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -63,11 +63,13 @@ number::to_dec_string() const std::uint32_t number::to_uint32() const { - if (*this > UINT32_MAX) { + auto size = _operands.size(); + + if (size > 1) { throw std::out_of_range("> UINT32_MAX"); } - return (*this == 0) ? 0 : _operands.front(); + return (size == 0) ? 0 : _operands.front(); } std::uint64_t |