BigInt now has a digits method (read comments)

Kind of unnecessary but included for completeness
This commit is contained in:
Ishaan Bhardwaj 2021-02-08 16:56:06 -05:00
parent 986ebac47f
commit bb0fe2ac20

View File

@ -106,6 +106,12 @@ function bigint.abs(big)
return result return result
end end
-- Return the number of digits in the big
function bigint.digits(big)
bigint.check(big)
return #big.digits
end
-- Convert a big to a number or string -- Convert a big to a number or string
function bigint.unserialize(big, output_type, precision) function bigint.unserialize(big, output_type, precision)
bigint.check(big) bigint.check(big)