Added bigint comparison metamethods

pull/17/head
Ishaan Bhardwaj 2021-05-15 22:39:15 -04:00
parent cbdbfa6633
commit f5121b62e5
1 changed files with 9 additions and 0 deletions

View File

@ -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
}