From f5121b62e54d48ba791162662ca9d34bfac6ddc8 Mon Sep 17 00:00:00 2001 From: Ishaan Bhardwaj Date: Sat, 15 May 2021 22:39:15 -0400 Subject: [PATCH] Added bigint comparison metamethods --- libs/bigint/bigint.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libs/bigint/bigint.lua b/libs/bigint/bigint.lua index 3f6e18f..aced005 100644 --- a/libs/bigint/bigint.lua +++ b/libs/bigint/bigint.lua @@ -32,6 +32,15 @@ local mt = { end, __tostring = function() return bigint.unserialize(self, "s") + end, + __eq = function(lhs, rhs) + return bigint.compare(lhs, rhs, "==") + end, + __lt = function(lhs, rhs) + return bigint.compare(lhs, rhs, "<") + end, + __le = function(lhs, rhs) + return bigint.compare(lhs, rhs, "<=") end }