From 4b85d229236b82f1a5cfdc5a8681a0b0831b541c Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Mon, 23 Aug 2021 16:30:10 +0200 Subject: [PATCH] abacus: bignum: add operator bool --- src/bignum/bignum.hh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/bignum/bignum.hh b/src/bignum/bignum.hh index 1880af0..c75e042 100644 --- a/src/bignum/bignum.hh +++ b/src/bignum/bignum.hh @@ -115,6 +115,10 @@ public: return !(lhs < rhs); } + explicit operator bool() { + return !is_zero(); + } + bool is_zero() const; bool is_positive() const; bool is_negative() const;