How to resolve the algorithm Arbitrary-precision integers (included) step by step in the Lua programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Arbitrary-precision integers (included) step by step in the Lua programming language

Table of Contents

Problem Statement

Using the in-built capabilities of your language, calculate the integer value of:

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Arbitrary-precision integers (included) step by step in the Lua programming language

Source code in the lua programming language

bc = require("bc")
-- since 5$=5^4$, and IEEE754 can handle 4$, this would be sufficient:
-- n = bc.pow(bc.new(5), bc.new(4^3^2))
-- but for this task:
n = bc.pow(bc.new(5), bc.pow(bc.new(4), bc.pow(bc.new(3), bc.new(2))))
s = n:tostring()
print(string.format("%s...%s (%d digits)", s:sub(1,20), s:sub(-20,-1), #s))


  

You may also check:How to resolve the algorithm Primality by trial division step by step in the Lambdatalk programming language
You may also check:How to resolve the algorithm Polymorphism step by step in the E programming language
You may also check:How to resolve the algorithm Find common directory path step by step in the OCaml programming language
You may also check:How to resolve the algorithm Mutex step by step in the Logtalk programming language
You may also check:How to resolve the algorithm Averages/Arithmetic mean step by step in the MiniScript programming language