What is the standard (or best supported) big number (arbitrary precision) library for Lua?

Using lbc instead of lmapm would be easier because lbc is self-contained.

local bc = require"bc"
s=bc.pow(2,1000):tostring()
z=0
for i=1,#s do
        z=z+s:byte(i)-("0"):byte(1)
end
print(z)

Leave a Comment