瀏覽代碼

LibCrypto: Add SignedBigInteger::is_positive()

Moustafa Raafat 2 年之前
父節點
當前提交
cfd684dc2f
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      Userland/Libraries/LibCrypto/BigInt/SignedBigInteger.h

+ 1 - 0
Userland/Libraries/LibCrypto/BigInt/SignedBigInteger.h

@@ -69,6 +69,7 @@ public:
 
     [[nodiscard]] UnsignedBigInteger const& unsigned_value() const { return m_unsigned_data; }
     [[nodiscard]] Vector<u32, STARTING_WORD_SIZE> const words() const { return m_unsigned_data.words(); }
+    [[nodiscard]] bool is_positive() const { return !is_negative() && !is_zero(); }
     [[nodiscard]] bool is_negative() const { return m_sign; }
     [[nodiscard]] bool is_zero() const { return m_unsigned_data.is_zero(); }