mirror of
https://github.com/SashLilac/cambridge.git
synced 2024-11-22 09:09:02 -06:00
Fixed unary negation and to-string bigint metamethods
This commit is contained in:
parent
ae1231c47a
commit
50466c5902
@ -12,8 +12,8 @@ local mt = {
|
|||||||
__add = function(lhs, rhs)
|
__add = function(lhs, rhs)
|
||||||
return bigint.add(lhs, rhs)
|
return bigint.add(lhs, rhs)
|
||||||
end,
|
end,
|
||||||
__unm = function()
|
__unm = function(arg)
|
||||||
return bigint.negate(self)
|
return bigint.negate(arg)
|
||||||
end,
|
end,
|
||||||
__sub = function(lhs, rhs)
|
__sub = function(lhs, rhs)
|
||||||
return bigint.subtract(lhs, rhs)
|
return bigint.subtract(lhs, rhs)
|
||||||
@ -30,8 +30,8 @@ local mt = {
|
|||||||
__pow = function(lhs, rhs)
|
__pow = function(lhs, rhs)
|
||||||
return bigint.exponentiate(lhs, rhs)
|
return bigint.exponentiate(lhs, rhs)
|
||||||
end,
|
end,
|
||||||
__tostring = function()
|
__tostring = function(arg)
|
||||||
return bigint.unserialize(self, "s")
|
return bigint.unserialize(arg, "s")
|
||||||
end,
|
end,
|
||||||
__eq = function(lhs, rhs)
|
__eq = function(lhs, rhs)
|
||||||
return bigint.compare(lhs, rhs, "==")
|
return bigint.compare(lhs, rhs, "==")
|
||||||
|
Loading…
Reference in New Issue
Block a user