From eb9b7c575037f28ebf13d1ec4cc0afa382ed295a Mon Sep 17 00:00:00 2001 From: Anish Ambekar <67278963+mangodo100@users.noreply.github.com> Date: Mon, 5 Oct 2020 18:36:15 +0530 Subject: [PATCH] Added implementation of Not_Equal_To --- big-int/src/operators/not_equal_to.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/big-int/src/operators/not_equal_to.cpp b/big-int/src/operators/not_equal_to.cpp index f2a0542..42a9d8b 100644 --- a/big-int/src/operators/not_equal_to.cpp +++ b/big-int/src/operators/not_equal_to.cpp @@ -32,5 +32,20 @@ namespace libbig { + bool largeInt:: operator != (const largeInt& z) { + if(this->sign != z.sign) { + return true; + } + if (this->number.length() != z.number.length()) { + return true; + } + for(int i = 0; i < this->number.length(); i++) { + if (this->number[i] != z.number[i]) { + return true; + } + } + return false; + } + } // namespace libbig