Tupper's self-referential formula: Difference between revisions
Content added Content deleted
(→{{header|ALGOL 68}}: Remove unnecessary line) |
(→{{header|Lua}}: Tweak) |
||
Line 157:
=={{header|Lua}}==
Tested with Lua 5.4.
{{Trans|Algol 68}}
Using Eduardo Bart's lua-bint pure Lua big integer library https://github.com/edubart/lua-bint.<br>
The precision of the big integers must be specified in bits as a parameter of the require.
<syntaxhighlight lang="lua">
do --
1/2 < floor( mod( (y/17)*2^ - ( 17x - mod(y,17) ), 2 ) )
where x in 0..106, y in k..k+16
--]]
local bint = require 'lua-bint-master\\bint'(2048) -- need around 600 digits▼
▲ local bint = require 'bint'(2048) -- need around 600 digits
local k = bint.fromstring( "960939379918958884971672962127852754715004339660129306651505" ..
Line 181 ⟶ 180:
"719" )
local
local b17 = bint.frominteger( 17 )
local
for yDelta = 0, 16 do
for x = 106, 0, -1 do
|