mirror of
https://github.com/SashLilac/cambridge.git
synced 2024-11-22 11:49:02 -06:00
Added another type check to the bigint
This commit is contained in:
parent
8418fc8ab7
commit
4920e5de1c
@ -82,7 +82,8 @@ function bigint.check(big, force)
|
||||
assert(type(big.sign) == "string", "bigint is unsigned")
|
||||
for _, digit in pairs(big.digits) do
|
||||
assert(type(digit) == "number", digit .. " is not a number")
|
||||
assert(digit < 10, digit .. " is greater than or equal to 10")
|
||||
assert(digit <= 9 and digit >= 0, digit .. " is not between 0 and 9")
|
||||
assert(math.floor(digit) == digit, digit .. " is not an integer")
|
||||
end
|
||||
end
|
||||
return true
|
||||
|
Loading…
Reference in New Issue
Block a user