{"id":332248,"date":"2022-04-21T15:01:11","date_gmt":"2022-04-21T15:01:11","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=332248"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=332248","title":{"rendered":"<span>use bigint \u0432 perl<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/99d\/e8b\/9ac\/99de8b9acdcee9723d0faa11f61d4db6.png\" width=\"1688\" height=\"300\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/99d\/e8b\/9ac\/99de8b9acdcee9723d0faa11f61d4db6.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0412 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0432\u0435\u0440\u0441\u0438\u0438 \u043c\u0430\u043d\u0442\u0438\u0441\u0441\u0430 \u0446\u0435\u043b\u044b\u0445 \u0447\u0438\u0441\u0435\u043b \u0432 <strong>perl<\/strong> 40 \u0431\u0438\u0442 (5 \u0431\u0430\u0439\u0442) \u0438\u043b\u0438 64 \u0431\u0438\u0442\u0430 (8 \u0431\u0430\u0439\u0442).<\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u0438\u0442 \u043e\u0442\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0430 \u0447\u0438\u0441\u043b\u043e \u0432 \u0442\u0435\u043a\u0443\u0449\u0435\u043c <strong>perl<\/strong> \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e:<\/p>\n<pre><code class=\"bash\">$ perl -e 'sub logn { log($_[1])\/log($_[0]) } print \"\u041c\u0430\u043d\u0442\u0438\u0441\u0441\u0430 \u0446\u0435\u043b\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u2014 \", logn(2, ~0+1), \" (\u0431\u0438\u0442)\\n\"' \u041c\u0430\u043d\u0442\u0438\u0441\u0441\u0430 \u0446\u0435\u043b\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u2014 64 (\u0431\u0438\u0442)<\/code><\/pre>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u0435\u0432\u044b\u0448\u0435\u043d\u0438\u044f \u043c\u0430\u043d\u0442\u0438\u0441\u0441\u044b \u0432 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0431\u0443\u0434\u0435\u0442 \u0432\u0435\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u0447\u0438\u0441\u043b\u043e\u043c \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0442\u043e\u0447\u043a\u043e\u0439. <\/p>\n<p>\u042f \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u0442\u0430\u043a\u0438\u043c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435\u043c <strong>perl<\/strong>, \u043a\u043e\u0433\u0434\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0441 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u043c \u0441\u0435\u0441\u0441\u0438\u0438 \u2014 64-\u0431\u0438\u0442\u043d\u044b\u043c \u0447\u0438\u0441\u043b\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u043b\u043e\u0441\u044c \u0432 \u043a\u0443\u043a\u0443 \u0432 64-\u0440\u0438\u0447\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0441\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f. <\/p>\n<blockquote>\n<p>\u0422\u0430\u043a\u0438\u0435 \u0436\u0435 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u044e\u0442\u044e\u0431 \u0434\u043b\u044f \u0441\u0432\u043e\u0438\u0445 \u0432\u0438\u0434\u0435\u043e. <br \/>\u0414\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u0447\u0438\u0441\u043b\u0430 \u0432 64-\u0440\u0438\u0447\u043d\u043e\u0439 \u0421\u0421 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0446\u0438\u0444\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f: \u0446\u0438\u0444\u0440\u044b, \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0438 \u043c\u0430\u043b\u044b\u0435 \u0431\u0443\u043a\u0432\u044b \u043b\u0430\u0442\u0438\u043d\u0441\u043a\u043e\u0433\u043e \u0430\u043b\u0444\u0430\u0432\u0438\u0442\u0430, \u0430 \u0442\u0430\u043a \u0436\u0435 \u0437\u043d\u0430\u043a\u0438 _ (\u043f\u043e\u0434\u0447\u0451\u0440\u043a) \u0438 &#8212; (\u0442\u0438\u0440\u0435).<br \/>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440: _m9ZDg8Ve7w<sub>64<\/sub> = 72348512559090795002<sub>10<\/sub>.<\/p>\n<\/blockquote>\n<p>\u041d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0441\u0442\u043e\u044f\u043b <strong>perl<\/strong> c 40-\u0431\u0438\u0442\u043d\u044b\u043c\u0438 \u0446\u0435\u043b\u044b\u043c\u0438. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0447\u0438\u0441\u043b\u0430 \u0438\u0437 64-\u0440\u0438\u0447\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0441\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f (<strong>from_radix<\/strong>) \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u044f\u043b \u043c\u0430\u043d\u0442\u0438\u0441\u0441\u0443 \u0438 \u0447\u0438\u0441\u043b\u043e \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u043b\u043e\u0441\u044c \u0432 \u0447\u0438\u0441\u043b\u043e \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0442\u043e\u0447\u043a\u043e\u0439 \u0438 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u2014 \u0441\u043e\u0432\u0441\u0435\u043c \u0434\u0440\u0443\u0433\u043e\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440. <\/p>\n<blockquote>\n<p>\u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0437\u043d\u0430\u044e\u0449\u0438\u0435 \u043b\u044e\u0434\u0438 \u0441\u043a\u0430\u0436\u0443\u0442, \u0447\u0442\u043e \u0432 \u043d\u0430\u0448 \u043f\u0440\u043e\u0441\u0432\u0435\u0449\u0451\u043d\u043d\u044b\u0439 \u0432\u0435\u043a \u0441\u0442\u043e\u0438\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <strong>docker<\/strong> \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0438 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435. \u041f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441 \u044d\u0442\u0438\u043c \u0441\u043e\u0433\u043b\u0430\u0441\u0435\u043d \u0438, \u043a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e <strong>docker<\/strong> \u0441\u0442\u0430\u043d\u0435\u0442 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u043c (\u043d\u0430\u0443\u0447\u0438\u0442\u0441\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b \u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c <strong>root<\/strong> \u043d\u0435 \u043e\u0442 \u0440\u0443\u0442\u0430, \u0447\u0442\u043e\u0431\u044b \u0447\u0435\u0440\u0435\u0437 <strong>\/proc<\/strong> \u043d\u0435\u043b\u044c\u0437\u044f \u0431\u044b\u043b\u043e \u0438\u0437 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u043f\u0440\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0445\u043e\u0441\u0442\u043e\u0432\u0443\u044e \u043c\u0430\u0448\u0438\u043d\u0443 \u0441 \u0440\u0443\u0442\u043e\u0432\u044b\u043c\u0438 \u043f\u0440\u0430\u0432\u0430\u043c\u0438), \u0442\u043e \u0441\u0440\u0430\u0437\u0443 \u0436\u0435 \u043d\u0430 \u043d\u0435\u0433\u043e \u0438 \u043f\u0435\u0440\u0435\u0439\u0434\u0443. \u041f\u043e\u043a\u0430 \u0436\u0435 \u043e\u0441\u0442\u0430\u044e\u0442\u0441\u044f <strong>lxc\/lxd<\/strong> (\u0443\u043c\u0435\u0435\u0442 \u043f\u043e\u0434\u043c\u0435\u043d\u044f\u0442\u044c \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u043d\u0435\u0440\u0443\u0442\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u0440\u0443\u0442\u043e\u0432\u043e\u0433\u043e \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435) \u0438 \u0442\u044f\u0436\u0451\u043b\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0432\u0440\u043e\u0434\u0435 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u0430\u0448\u0438\u043d. \u0412\u043f\u0440\u043e\u0447\u0435\u043c, <strong>vagrant<\/strong> \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0438 <strong>lcx<\/strong> \u0438 <strong>virtualbox<\/strong>, \u0442\u0430\u043a \u0447\u0442\u043e \u2014 \u0435\u0441\u0442\u044c, \u0433\u0434\u0435 \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f.<\/p>\n<\/blockquote>\n<p>\u041f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u043f\u0430\u0441 <strong>use bigint<\/strong>. \u042d\u0442\u0430 \u043f\u0440\u0430\u0433\u043c\u0430 \u0432\u0441\u0435\u043c \u0446\u0435\u043b\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0430\u043c \u0432 \u0431\u043b\u043e\u043a\u0435, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0443\u043a\u0430\u0437\u0430\u043d\u0430, \u043f\u0440\u0438\u0434\u0430\u0451\u0442 \u0431\u043b\u0435\u0441\u043a <strong>Math::BigInt<\/strong> \u0438 \u0441\u043b\u0435\u0434\u0438\u0442 \u0437\u0430 \u0442\u0435\u043c, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0438 \u0438\u043c\u0435\u043b\u0438 64-\u0431\u0438\u0442\u043d\u0443\u044e \u043c\u0430\u043d\u0442\u0438\u0441\u0441\u0443 \u0432\u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0432\u0435\u0440\u0441\u0438\u0438 <strong>perl<\/strong>-\u0430:<\/p>\n<pre><code class=\"bash\">$ perl -e 'use bigint; print ref 10' Math::BigInt<\/code><\/pre>\n<p>\u041d\u0430\u043f\u043e\u0441\u043b\u0435\u0434\u043e\u043a \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430 \u0447\u0438\u0441\u0435\u043b \u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0441\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f:<\/p>\n<pre><code class=\"perl\">use utf8;  # \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0438\u0437 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0438 cp1251, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0434\u043b\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u044b our $CIF = join \"\", \"0\"..\"9\", \"A\"..\"Z\", \"a\"..\"z\", \"_-\", # 64 \u0441\u0438\u043c\u0432\u043e\u043b\u0430 \u0434\u043b\u044f 64-\u0440\u0438\u0447\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0441\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f (map chr, ord \"\u0410\" .. ord \"\u042f\"), \"\u0401\u0402\u0403\u0409\u040a\u040c\u040b\u040f\u040e\u0408\u0490\u0404\u0407\u0406\u0405\",  (map chr, ord \"\u0430\" .. ord \"\u044f\"), \"\u0451\u0452\u0453\u0459\u045a\u045c\u045b\u045f\u045e\u0458\u0491\u0454\u0457\u0456\u0455\", \"\u201a\u201e\u2026\u2020\u2021\u20ac\u2030\u2039\u2018\u2019\u201c\u201d\u2022\u2013\u2014\u2122\u203a\u00a4\u00a6\u00a7\u00a9\u00ab\u00ac\u00ad\u00ae\u00b0\u00b1\u00b5\u00b6\u00b7\u2116\u00bb\",do { no utf8; chr 0xa0 }, # \u043d\u0435\u0431\u0443\u043a\u0432\u0435\u043d\u043d\u044b\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0438\u0437 cp1251 \"!\\\"#\\$%&amp;'()*+,.\/:;&lt;=>?\\@[\\\\]^`{|}~\", # \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u043f\u0443\u043d\u043a\u0442\u0443\u0430\u0446\u0438\u0438 ASCII \" \", # \u043f\u0440\u043e\u0431\u0435\u043b (map chr, 0 .. 0x1F, 0x7F), # \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b ASCII # \u0441\u0438\u043c\u0432\u043e\u043b 152 (0x98) \u0432 cp1251 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442. ;  # \u041f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u0442 \u043d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0432 \u0437\u0430\u0434\u0430\u043d\u043d\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0441\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f sub to_radix(@) { use bigint; my ($n, $radix) = @_; $radix \/\/= 64; die \"to_radix: \u0421\u043b\u0438\u0448\u043a\u043e\u043c \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0441\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f $radix. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0421\u0421 \u0434\u043e \" . (1 + length $CIF) if $radix > length $CIF; $n += 0; $radix += 0; my $x = \"\"; for(;;) { my $cif_idx = $n % $radix; my $cif = substr $CIF, $cif_idx, 1; $x =~ s\/^\/$cif\/; last unless $n = int($n \/ $radix); } return $x; }  # \u041f\u0430\u0440\u0441\u0438\u0442 \u043d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0432 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0441\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f sub from_radix(@) { use bigint; my ($s, $radix) = @_; $radix \/\/= 64; $radix += 0; die \"from_radix: \u0421\u043b\u0438\u0448\u043a\u043e\u043c \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0441\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f $radix. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0421\u0421 \u0434\u043e \" . length $CIF if $radix > length $CIF; my $x = 0; for my $ch (split \"\", $s) { $x = $x*$radix + index $CIF, $ch; } return $x; }<\/code><\/pre>\n<p>\u041a\u0430\u043a \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u0438\u0434\u0435\u0442\u044c, \u043f\u0440\u0438\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0447\u0438\u0441\u043b\u0430 \u043d\u0438\u043a\u0430\u043a \u043f\u0440\u0430\u0433\u043c\u043e\u0439 <strong>use bigint<\/strong> \u043d\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u044e\u0442\u0441\u044f. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u043d\u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u044e\u0442\u0441\u044f \u043a \u0447\u0438\u0441\u043b\u0443 <strong>Math::BigInt<\/strong> \u043f\u0440\u0438\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u043d\u0443\u043b\u044f ($radix += 0).<\/p>\n<blockquote>\n<p>\u0427\u0442\u043e \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u0431\u043e\u0440\u0430 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0434\u043b\u044f \u0446\u0438\u0444\u0440 \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445 \u0441\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f (\u0432 <strong>$CIF <\/strong>\u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0447\u0438\u0441\u0435\u043b \u0434\u043b\u044f \u0421\u0421 \u0434\u043e 255 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e) \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0438 <strong>cp1251<\/strong>, \u0442\u043e \u044f \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u044e\u043d\u0438\u043a\u043e\u0434\u043e\u0432\u0441\u043a\u0438\u0445 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0432 \u0431\u0430\u0437\u0443 \u0441 COLLATE cp1251_general_ci. \u042d\u0442\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u043c\u0435\u0441\u0442\u043e \u0432 \u0431\u0430\u0437\u0435, \u0432\u0432\u0438\u0434\u0443 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0440\u0443\u0441\u0441\u043a\u0438\u0435 \u0431\u0443\u043a\u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0447\u0430\u0449\u0435 \u044e\u043d\u0438\u043a\u043e\u0434\u043e\u0432\u0441\u043a\u0438\u0445 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432.<br \/>\u0415\u0441\u043b\u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u2014 \u0434\u0430\u0439\u0442\u0435 \u0437\u043d\u0430\u0442\u044c \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445 \u0438 \u044f \u043d\u0430\u043f\u0438\u0448\u0443 \u0441\u0442\u0430\u0442\u044c\u044e \u0438 \u043e\u0431 \u044d\u0442\u043e\u043c.<\/p>\n<\/blockquote>\n<h2>\u0422\u0415\u0417\u0410\u0423\u0420\u0423\u0421<\/h2>\n<ul>\n<li>\n<p>CC \u2014 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0441\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f.<\/p>\n<\/li>\n<\/ul>\n<h2>\u0421\u0421\u042b\u041b\u041a\u0418<\/h2>\n<ol>\n<li>\n<p>U. Windl \u201eHow to check availability of 64-bit integers (for `use integer`)?\u201d \/ <a href=\"https:\/\/stackoverflow.com\/questions\/68890205\/how-to-check-availability-of-64-bit-integers-for-use-integer\" rel=\"noopener noreferrer nofollow\">https:\/\/stackoverflow.com\/questions\/68890205\/how-to-check-availability-of-64-bit-integers-for-use-integer<\/a><\/p>\n<\/li>\n<li>\n<p>SquarePerl \u201e\u0424\u0443\u043d\u043a\u0446\u0438\u044f\u00a0log()\u00a0\u0432 Perl\u201d \/ <a href=\"https:\/\/squareperl.com\/ru\/function\/log\" rel=\"noopener noreferrer nofollow\">https:\/\/squareperl.com\/ru\/function\/log<\/a><\/p>\n<\/li>\n<\/ol>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/662213\/\"> https:\/\/habr.com\/ru\/post\/662213\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0412 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0432\u0435\u0440\u0441\u0438\u0438 \u043c\u0430\u043d\u0442\u0438\u0441\u0441\u0430 \u0446\u0435\u043b\u044b\u0445 \u0447\u0438\u0441\u0435\u043b \u0432 <strong>perl<\/strong> 40 \u0431\u0438\u0442 (5 \u0431\u0430\u0439\u0442) \u0438\u043b\u0438 64 \u0431\u0438\u0442\u0430 (8 \u0431\u0430\u0439\u0442).<\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u0438\u0442 \u043e\u0442\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0430 \u0447\u0438\u0441\u043b\u043e \u0432 \u0442\u0435\u043a\u0443\u0449\u0435\u043c <strong>perl<\/strong> \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e:<\/p>\n<pre><code class=\"bash\">$ perl -e 'sub logn { log($_[1])\/log($_[0]) } print \"\u041c\u0430\u043d\u0442\u0438\u0441\u0441\u0430 \u0446\u0435\u043b\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u2014 \", logn(2, ~0+1), \" (\u0431\u0438\u0442)\\n\"' \u041c\u0430\u043d\u0442\u0438\u0441\u0441\u0430 \u0446\u0435\u043b\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u2014 64 (\u0431\u0438\u0442)<\/code><\/pre>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u0435\u0432\u044b\u0448\u0435\u043d\u0438\u044f \u043c\u0430\u043d\u0442\u0438\u0441\u0441\u044b \u0432 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0431\u0443\u0434\u0435\u0442 \u0432\u0435\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u0447\u0438\u0441\u043b\u043e\u043c \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0442\u043e\u0447\u043a\u043e\u0439. <\/p>\n<p>\u042f \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u0442\u0430\u043a\u0438\u043c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435\u043c <strong>perl<\/strong>, \u043a\u043e\u0433\u0434\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0441 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u043e\u043c \u0441\u0435\u0441\u0441\u0438\u0438 \u2014 64-\u0431\u0438\u0442\u043d\u044b\u043c \u0447\u0438\u0441\u043b\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u043b\u043e\u0441\u044c \u0432 \u043a\u0443\u043a\u0443 \u0432 64-\u0440\u0438\u0447\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0441\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f. <\/p>\n<blockquote>\n<p>\u0422\u0430\u043a\u0438\u0435 \u0436\u0435 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u044e\u0442\u044e\u0431 \u0434\u043b\u044f \u0441\u0432\u043e\u0438\u0445 \u0432\u0438\u0434\u0435\u043e. <br \/>\u0414\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u0447\u0438\u0441\u043b\u0430 \u0432 64-\u0440\u0438\u0447\u043d\u043e\u0439 \u0421\u0421 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0446\u0438\u0444\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f: \u0446\u0438\u0444\u0440\u044b, \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0438 \u043c\u0430\u043b\u044b\u0435 \u0431\u0443\u043a\u0432\u044b \u043b\u0430\u0442\u0438\u043d\u0441\u043a\u043e\u0433\u043e \u0430\u043b\u0444\u0430\u0432\u0438\u0442\u0430, \u0430 \u0442\u0430\u043a \u0436\u0435 \u0437\u043d\u0430\u043a\u0438 _ (\u043f\u043e\u0434\u0447\u0451\u0440\u043a) \u0438 &#8212; (\u0442\u0438\u0440\u0435).<br \/>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440: _m9ZDg8Ve7w<sub>64<\/sub> = 72348512559090795002<sub>10<\/sub>.<\/p>\n<\/blockquote>\n<p>\u041d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0441\u0442\u043e\u044f\u043b <strong>perl<\/strong> c 40-\u0431\u0438\u0442\u043d\u044b\u043c\u0438 \u0446\u0435\u043b\u044b\u043c\u0438. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0447\u0438\u0441\u043b\u0430 \u0438\u0437 64-\u0440\u0438\u0447\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0441\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f (<strong>from_radix<\/strong>) \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u044f\u043b \u043c\u0430\u043d\u0442\u0438\u0441\u0441\u0443 \u0438 \u0447\u0438\u0441\u043b\u043e \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u043b\u043e\u0441\u044c \u0432 \u0447\u0438\u0441\u043b\u043e \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0442\u043e\u0447\u043a\u043e\u0439 \u0438 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u2014 \u0441\u043e\u0432\u0441\u0435\u043c \u0434\u0440\u0443\u0433\u043e\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440. <\/p>\n<blockquote>\n<p>\u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0437\u043d\u0430\u044e\u0449\u0438\u0435 \u043b\u044e\u0434\u0438 \u0441\u043a\u0430\u0436\u0443\u0442, \u0447\u0442\u043e \u0432 \u043d\u0430\u0448 \u043f\u0440\u043e\u0441\u0432\u0435\u0449\u0451\u043d\u043d\u044b\u0439 \u0432\u0435\u043a \u0441\u0442\u043e\u0438\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <strong>docker<\/strong> \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0438 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435. \u041f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441 \u044d\u0442\u0438\u043c \u0441\u043e\u0433\u043b\u0430\u0441\u0435\u043d \u0438, \u043a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e <strong>docker<\/strong> \u0441\u0442\u0430\u043d\u0435\u0442 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u043c (\u043d\u0430\u0443\u0447\u0438\u0442\u0441\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b \u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c <strong>root<\/strong> \u043d\u0435 \u043e\u0442 \u0440\u0443\u0442\u0430, \u0447\u0442\u043e\u0431\u044b \u0447\u0435\u0440\u0435\u0437 <strong>\/proc<\/strong> \u043d\u0435\u043b\u044c\u0437\u044f \u0431\u044b\u043b\u043e \u0438\u0437 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u043f\u0440\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0445\u043e\u0441\u0442\u043e\u0432\u0443\u044e \u043c\u0430\u0448\u0438\u043d\u0443 \u0441 \u0440\u0443\u0442\u043e\u0432\u044b\u043c\u0438 \u043f\u0440\u0430\u0432\u0430\u043c\u0438), \u0442\u043e \u0441\u0440\u0430\u0437\u0443 \u0436\u0435 \u043d\u0430 \u043d\u0435\u0433\u043e \u0438 \u043f\u0435\u0440\u0435\u0439\u0434\u0443. \u041f\u043e\u043a\u0430 \u0436\u0435 \u043e\u0441\u0442\u0430\u044e\u0442\u0441\u044f <strong>lxc\/lxd<\/strong> (\u0443\u043c\u0435\u0435\u0442 \u043f\u043e\u0434\u043c\u0435\u043d\u044f\u0442\u044c \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u043d\u0435\u0440\u0443\u0442\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u0440\u0443\u0442\u043e\u0432\u043e\u0433\u043e \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435) \u0438 \u0442\u044f\u0436\u0451\u043b\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0432\u0440\u043e\u0434\u0435 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u0430\u0448\u0438\u043d. \u0412\u043f\u0440\u043e\u0447\u0435\u043c, <strong>vagrant<\/strong> \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0438 <strong>lcx<\/strong> \u0438 <strong>virtualbox<\/strong>, \u0442\u0430\u043a \u0447\u0442\u043e \u2014 \u0435\u0441\u0442\u044c, \u0433\u0434\u0435 \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f.<\/p>\n<\/blockquote>\n<p>\u041f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u043f\u0430\u0441 <strong>use bigint<\/strong>. \u042d\u0442\u0430 \u043f\u0440\u0430\u0433\u043c\u0430 \u0432\u0441\u0435\u043c \u0446\u0435\u043b\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0430\u043c \u0432 \u0431\u043b\u043e\u043a\u0435, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0443\u043a\u0430\u0437\u0430\u043d\u0430, \u043f\u0440\u0438\u0434\u0430\u0451\u0442 \u0431\u043b\u0435\u0441\u043a <strong>Math::BigInt<\/strong> \u0438 \u0441\u043b\u0435\u0434\u0438\u0442 \u0437\u0430 \u0442\u0435\u043c, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0438 \u0438\u043c\u0435\u043b\u0438 64-\u0431\u0438\u0442\u043d\u0443\u044e \u043c\u0430\u043d\u0442\u0438\u0441\u0441\u0443 \u0432\u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0432\u0435\u0440\u0441\u0438\u0438 <strong>perl<\/strong>-\u0430:<\/p>\n<pre><code class=\"bash\">$ perl -e 'use bigint; print ref 10' Math::BigInt<\/code><\/pre>\n<p>\u041d\u0430\u043f\u043e\u0441\u043b\u0435\u0434\u043e\u043a \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430 \u0447\u0438\u0441\u0435\u043b \u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0441\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f:<\/p>\n<pre><code class=\"perl\">use utf8;  # \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0438\u0437 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0438 cp1251, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0434\u043b\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u044b our $CIF = join \"\", \"0\"..\"9\", \"A\"..\"Z\", \"a\"..\"z\", \"_-\", # 64 \u0441\u0438\u043c\u0432\u043e\u043b\u0430 \u0434\u043b\u044f 64-\u0440\u0438\u0447\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0441\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f (map chr, ord \"\u0410\" .. ord \"\u042f\"), \"\u0401\u0402\u0403\u0409\u040a\u040c\u040b\u040f\u040e\u0408\u0490\u0404\u0407\u0406\u0405\",  (map chr, ord \"\u0430\" .. ord \"\u044f\"), \"\u0451\u0452\u0453\u0459\u045a\u045c\u045b\u045f\u045e\u0458\u0491\u0454\u0457\u0456\u0455\", \"\u201a\u201e\u2026\u2020\u2021\u20ac\u2030\u2039\u2018\u2019\u201c\u201d\u2022\u2013\u2014\u2122\u203a\u00a4\u00a6\u00a7\u00a9\u00ab\u00ac\u00ad\u00ae\u00b0\u00b1\u00b5\u00b6\u00b7\u2116\u00bb\",do { no utf8; chr 0xa0 }, # \u043d\u0435\u0431\u0443\u043a\u0432\u0435\u043d\u043d\u044b\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0438\u0437 cp1251 \"!\\\"#\\$%&amp;'()*+,.\/:;&lt;=>?\\@[\\\\]^`{|}~\", # \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u043f\u0443\u043d\u043a\u0442\u0443\u0430\u0446\u0438\u0438 ASCII \" \", # \u043f\u0440\u043e\u0431\u0435\u043b (map chr, 0 .. 0x1F, 0x7F), # \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b ASCII # \u0441\u0438\u043c\u0432\u043e\u043b 152 (0x98) \u0432 cp1251 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442. ;  # \u041f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u0442 \u043d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0432 \u0437\u0430\u0434\u0430\u043d\u043d\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0441\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f sub to_radix(@) { use bigint; my ($n, $radix) = @_; $radix \/\/= 64; die \"to_radix: \u0421\u043b\u0438\u0448\u043a\u043e\u043c \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0441\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f $radix. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0421\u0421 \u0434\u043e \" . (1 + length $CIF) if $radix > length $CIF; $n += 0; $radix += 0; my $x = \"\"; for(;;) { my $cif_idx = $n % $radix; my $cif = substr $CIF, $cif_idx, 1; $x =~ s\/^\/$cif\/; last unless $n = int($n \/ $radix); } return $x; }  # \u041f\u0430\u0440\u0441\u0438\u0442 \u043d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0432 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0441\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f sub from_radix(@) { use bigint; my ($s, $radix) = @_; $radix \/\/= 64; $radix += 0; die \"from_radix: \u0421\u043b\u0438\u0448\u043a\u043e\u043c \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0441\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f $radix. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0421\u0421 \u0434\u043e \" . length $CIF if $radix > length $CIF; my $x = 0; for my $ch (split \"\", $s) { $x = $x*$radix + index $CIF, $ch; } return $x; }<\/code><\/pre>\n<p>\u041a\u0430\u043a \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u0438\u0434\u0435\u0442\u044c, \u043f\u0440\u0438\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0447\u0438\u0441\u043b\u0430 \u043d\u0438\u043a\u0430\u043a \u043f\u0440\u0430\u0433\u043c\u043e\u0439 <strong>use bigint<\/strong> \u043d\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u044e\u0442\u0441\u044f. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u043d\u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u044e\u0442\u0441\u044f \u043a \u0447\u0438\u0441\u043b\u0443 <strong>Math::BigInt<\/strong> \u043f\u0440\u0438\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u043d\u0443\u043b\u044f ($radix += 0).<\/p>\n<blockquote>\n<p>\u0427\u0442\u043e \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u0431\u043e\u0440\u0430 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0434\u043b\u044f \u0446\u0438\u0444\u0440 \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445 \u0441\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f (\u0432 <strong>$CIF <\/strong>\u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0447\u0438\u0441\u0435\u043b \u0434\u043b\u044f \u0421\u0421 \u0434\u043e 255 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e) \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0438 <strong>cp1251<\/strong>, \u0442\u043e \u044f \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u044e\u043d\u0438\u043a\u043e\u0434\u043e\u0432\u0441\u043a\u0438\u0445 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0432 \u0431\u0430\u0437\u0443 \u0441 COLLATE cp1251_general_ci. \u042d\u0442\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u043c\u0435\u0441\u0442\u043e \u0432 \u0431\u0430\u0437\u0435, \u0432\u0432\u0438\u0434\u0443 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0440\u0443\u0441\u0441\u043a\u0438\u0435 \u0431\u0443\u043a\u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0447\u0430\u0449\u0435 \u044e\u043d\u0438\u043a\u043e\u0434\u043e\u0432\u0441\u043a\u0438\u0445 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432.<br \/>\u0415\u0441\u043b\u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u2014 \u0434\u0430\u0439\u0442\u0435 \u0437\u043d\u0430\u0442\u044c \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445 \u0438 \u044f \u043d\u0430\u043f\u0438\u0448\u0443 \u0441\u0442\u0430\u0442\u044c\u044e \u0438 \u043e\u0431 \u044d\u0442\u043e\u043c.<\/p>\n<\/blockquote>\n<h2>\u0422\u0415\u0417\u0410\u0423\u0420\u0423\u0421<\/h2>\n<ul>\n<li>\n<p>CC \u2014 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0441\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f.<\/p>\n<\/li>\n<\/ul>\n<h2>\u0421\u0421\u042b\u041b\u041a\u0418<\/h2>\n<ol>\n<li>\n<p>U. Windl \u201eHow to check availability of 64-bit integers (for `use integer`)?\u201d \/ <a href=\"https:\/\/stackoverflow.com\/questions\/68890205\/how-to-check-availability-of-64-bit-integers-for-use-integer\" rel=\"noopener noreferrer nofollow\">https:\/\/stackoverflow.com\/questions\/68890205\/how-to-check-availability-of-64-bit-integers-for-use-integer<\/a><\/p>\n<\/li>\n<li>\n<p>SquarePerl \u201e\u0424\u0443\u043d\u043a\u0446\u0438\u044f\u00a0log()\u00a0\u0432 Perl\u201d \/ <a href=\"https:\/\/squareperl.com\/ru\/function\/log\" rel=\"noopener noreferrer nofollow\">https:\/\/squareperl.com\/ru\/function\/log<\/a><\/p>\n<\/li>\n<\/ol>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/662213\/\"> https:\/\/habr.com\/ru\/post\/662213\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-332248","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/332248","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=332248"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/332248\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=332248"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=332248"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=332248"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}