{"id":315582,"date":"2020-12-26T15:00:24","date_gmt":"2020-12-26T15:00:24","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=315582"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=315582","title":{"rendered":"\u0423\u0441\u0442\u0430\u043b\u0438 \u043e\u0442 \u0433\u043b\u0443\u043f\u044b\u0445 \u0448\u0443\u0442\u043e\u043a \u043e JS? \u041d\u0430\u043f\u0438\u0448\u0438\u0442\u0435 \u0441\u0432\u043e\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">\u0412 JavaScript \u0435\u0441\u0442\u044c \u043d\u0435\u043c\u0430\u043b\u043e \u043c\u043e\u043c\u0435\u043d\u0442\u043e\u0432, \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u0445 \u0432\u043e\u043f\u0440\u043e\u0441 \u00ab\u0427\u0435\u0433\u043e???\u00bb. \u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e \u0447\u0442\u043e \u0443 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0430 \u0438\u0437 \u043d\u0438\u0445 \u0435\u0441\u0442\u044c \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u0435, \u0435\u0441\u043b\u0438 \u0432\u044b \u0432\u043d\u0438\u043a\u043d\u0435\u0442\u0435, \u043e\u043d\u0438 \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u043c\u043e\u0433\u0443\u0442 \u0443\u0434\u0438\u0432\u043b\u044f\u0442\u044c. \u041d\u043e JavaScript \u0442\u043e\u0447\u043d\u043e \u043d\u0435 \u0437\u0430\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u0435\u0442 \u0432\u043e\u0437\u043c\u0443\u0442\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0448\u0443\u0442\u043e\u043a \u0442\u0438\u043f\u0430 \u044d\u0442\u043e\u0439 \u0441\u043c\u0435\u0445\u0430. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0438\u043d\u043e\u0433\u0434\u0430 \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u0442\u0430\u043a\u0438\u0435 \u0448\u0443\u0442\u043a\u0438:<\/p>\n<p>  <a href=\"https:\/\/habr.com\/ru\/company\/skillfactory\/blog\/535138\/\"><\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/bu\/zy\/gp\/buzygp2yrzz9bfh4y_4dl6w77-i.jpeg\"><\/div>\n<p><\/a><br \/>  \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u0440\u0438\u0442\u0438\u043a\u0430 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u043d\u0435 \u0437\u0430\u0441\u043b\u0443\u0436\u0435\u043d\u0430. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u0447\u0435\u043c\u0443.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<hr>\n<p>  JavaScript, \u043a\u0430\u043a \u0438 <i>\u043a\u0430\u043a\u043e\u0439-\u043b\u0438\u0431\u043e \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0439 \u044f\u0437\u044b\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f<\/i>, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0447\u0438\u0441\u043b\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0435 \u0435\u0434\u0438\u043d\u044b\u0439 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442. \u0415\u0441\u043b\u0438 \u0431\u044b\u0442\u044c \u0442\u043e\u0447\u043d\u044b\u043c, \u044d\u0442\u043e <a href=\"https:\/\/standards.ieee.org\/standard\/754-2008.html\">\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 IEEE 754<\/a> \u0434\u043b\u044f \u0447\u0438\u0441\u0435\u043b \u0432 64-\u0431\u0438\u0442\u043d\u043e\u043c \u0434\u0432\u043e\u0438\u0447\u043d\u043e\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0435. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u044d\u0442\u0443 \u0436\u0435 \u0448\u0443\u0442\u043a\u0443 \u043d\u0430 \u0434\u0440\u0443\u0433\u0438\u0445 \u044f\u0437\u044b\u043a\u0430\u0445:<\/p>\n<p>  \u041a\u0430\u043a \u043d\u0430\u0441\u0447\u0451\u0442 Ruby? <i>\u041d\u0430 \u043a\u0430\u043a\u043e\u043c \u044f\u0437\u044b\u043a\u0435 0.1 + 0.2 \u043d\u0435 \u0440\u0430\u0432\u043d\u043e 0.3?<\/i><\/p>\n<pre><code class=\"ruby\">$ irb irb(main):001:0&gt; 0.1 + 0.2 == 0.3 =&gt; false irb(main):002:0&gt; 0.1 + 0.2 =&gt; 0.30000000000000004<\/code><\/pre>\n<p>  Ruby! \u041a\u0430\u043a\u043e\u0439 \u0433\u043b\u0443\u043f\u044b\u0439 \u044f\u0437\u044b\u043a.<\/p>\n<p>  \u0418\u043b\u0438 Clojure? <i>\u041d\u0430 \u043a\u0430\u043a\u043e\u043c \u044f\u0437\u044b\u043a\u0435 0.1 + 0.2 \u043d\u0435 \u0440\u0430\u0432\u043d\u043e 0.3?<\/i><\/p>\n<pre><code class=\"plaintext\">$ clj Clojure 1.10.1 user=&gt; (== (+ 0.1 0.2) 0.3) false user=&gt; (+ 0.1 0.2) 0.30000000000000004 <\/code><\/pre>\n<p>  Clojure! \u041a\u0430\u043a\u043e\u0439 \u0433\u043b\u0443\u043f\u044b\u0439 \u044f\u0437\u044b\u043a.<\/p>\n<p>  \u0418\u043b\u0438 \u043a\u0430\u043a \u043d\u0430\u0441\u0447\u0451\u0442 \u043c\u043e\u0433\u0443\u0447\u0435\u0433\u043e Haskell? <i>\u041d\u0430 \u043a\u0430\u043a\u043e\u043c \u044f\u0437\u044b\u043a\u0435 0.1 + 0.2 \u043d\u0435 \u0440\u0430\u0432\u043d\u043e 0.3?<\/i><\/p>\n<pre><code class=\"haskell\">$ ghci GHCi, version 8.10.1: https:\/\/www.haskell.org\/ghc\/  :? for help Prelude&gt; 0.1 + 0.2 == 0.3 False Prelude&gt; 0.1 + 0.2 0.30000000000000004 <\/code><\/pre>\n<p>  Haskell! \u0425\u0430\u0445\u0430\u0445\u0430. \u041a\u0430\u043a\u043e\u0439 \u0433\u043b\u0443\u043f\u044b\u0439 \u044f\u0437\u044b\u043a\u2026<\/p>\n<p>  \u0412\u044b \u043f\u043e\u043d\u044f\u043b\u0438 \u043c\u044b\u0441\u043b\u044c. \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0437\u0434\u0435\u0441\u044c \u043d\u0435 \u0432 JavaScript. \u042d\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0447\u0438\u0441\u0435\u043b \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0442\u043e\u0447\u043a\u043e\u0439 \u0432 \u0434\u0432\u043e\u0438\u0447\u043d\u043e\u043c \u0432\u0438\u0434\u0435. \u041d\u043e \u044f \u043d\u0435 \u0445\u043e\u0447\u0443 \u043f\u043e\u043a\u0430 \u0432\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 IEEE 754. \u041f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e, \u0435\u0441\u043b\u0438 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u044b \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0435 \u0442\u043e\u0447\u043d\u044b\u0435 \u0447\u0438\u0441\u043b\u0430, JavaScript \u0434\u0435\u043b\u0430\u0435\u0442 \u0438\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u043c\u0438. \u0421 \u043e\u043a\u0442\u044f\u0431\u0440\u044f 2019 \u0433\u043e\u0434\u0430 BigInt \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0432\u0445\u043e\u0434\u0438\u0442 \u0432 <a href=\"https:\/\/tc39.es\/ecma262\/#sec-bigint-objects\">\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 TC39 ECMAScript<\/a>.<\/p>\n<p>  <font color=\"#09b744\"><\/p>\n<h2>\u0417\u0430\u0447\u0435\u043c \u0431\u0435\u0441\u043f\u043e\u043a\u043e\u0438\u0442\u044c\u0441\u044f \u043e\u0431 \u044d\u0442\u043e\u043c?<\/h2>\n<p><\/font><br \/>  \u041c\u044b \u043f\u0440\u043e\u0434\u0435\u0440\u0436\u0430\u043b\u0438\u0441\u044c \u0441 IEEE 754 \u0446\u0435\u043b\u0443\u044e \u0432\u0435\u0447\u043d\u043e\u0441\u0442\u044c. \u0411\u043e\u043b\u044c\u0448\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u044d\u0442\u043e \u043d\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439. \u041f\u0440\u0430\u0432\u0434\u0430. \u041f\u043e\u0447\u0442\u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u044d\u0442\u043e \u043d\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430. \u041d\u043e \u0438\u043d\u043e\u0433\u0434\u0430 \u044d\u0442\u043e \u0432\u0441\u0451-\u0442\u0430\u043a\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430. \u0418 \u0432 \u0442\u0430\u043a\u0438\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b \u0445\u043e\u0440\u043e\u0448\u043e \u0438\u043c\u0435\u0442\u044c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b.<\/p>\n<p>  \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0433\u043e\u0434\u0430 \u044f \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u043d\u0430\u0434 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c. \u0425\u043e\u0442\u0435\u043b \u043d\u0430\u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u0435\u0447\u043d\u044b\u0435 \u0433\u0440\u0430\u0444\u0438\u043a\u0438 \u043d\u0430 SVG. \u0410 \u0432 SVG \u0435\u0441\u0442\u044c \u0442\u0430\u043a\u0430\u044f \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u0430\u044f <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/SVG\/Attribute\/transform\">transform<\/a>. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u0435\u0451 \u043a \u0433\u0440\u0443\u043f\u043f\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u0438 \u043e\u043d\u0430 \u0438\u0437\u043c\u0435\u043d\u0438\u0442 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u0434\u043b\u044f \u044d\u0442\u0438\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432. \u0422\u0430\u043a \u0447\u0442\u043e \u0441 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043e\u0441\u0442\u043e\u0440\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u044b. \u0412\u043c\u0435\u0441\u0442\u043e \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0442\u044c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0433\u0440\u0430\u0444\u0438\u043a\u0430 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0432\u0435\u0447\u0438, \u0432\u044b \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0435 \u043e\u0434\u043d\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435. \u0410 \u0437\u0430\u0442\u0435\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0435 \u043a\u0430\u0436\u0434\u0443\u044e \u0441\u0432\u0435\u0447\u0443, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441\u044b\u0440\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. \u041e\u0447\u0435\u043d\u044c \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u043e. \u041f\u043e \u043a\u0440\u0430\u0439\u043d\u0435\u0439 \u043c\u0435\u0440\u0435 \u0432 \u0442\u0435\u043e\u0440\u0438\u0438.<\/p>\n<p>  \u041d\u043e \u0432 \u0442\u0435\u0441\u0442\u0430\u0445 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u0443 \u043c\u0435\u043d\u044f \u0431\u044b\u043b\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b. \u0415\u0441\u043b\u0438 \u0431\u044b \u0433\u0440\u0430\u0444\u0438\u043a \u0431\u044b\u043b \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u043c, \u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0431\u044b\u043b\u0438 \u0431\u043e\u043b\u044c\u0448\u0438\u043c\u0438, \u044f \u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u043e\u0448\u0438\u0431\u043a\u0438 \u043e\u043a\u0440\u0443\u0433\u043b\u0435\u043d\u0438\u044f. \u0418 \u0437\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u044d\u0442\u043e \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e. \u041d\u043e \u043d\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u0435 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0438\u043a\u0441\u0435\u043b\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u0432\u044b\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043b\u0438\u043d\u0438\u044e. \u0418\u043d\u0430\u0447\u0435 \u0440\u0438\u0441\u0443\u043d\u043e\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e. \u0422\u0430\u043a \u0447\u0442\u043e \u044f \u043d\u0430\u0447\u0430\u043b \u0438\u0437\u0443\u0447\u0430\u0442\u044c BigInt. \u0418\u0442\u043e\u0433\u043e\u043c \u0441\u0442\u0430\u043b\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u044f \u043d\u0430\u0437\u0432\u0430\u043b Ratio. \u0418 \u044f \u043f\u043e\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u043e\u043d\u0430 \u043f\u0438\u0448\u0435\u0442\u0441\u044f.<\/p>\n<p>  <font color=\"#09b744\"><\/p>\n<h2>\u041a\u043b\u0430\u0441\u0441 \u0434\u0440\u043e\u0431\u0438<\/h2>\n<p><\/font><br \/>  \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0441 \u0447\u0438\u0441\u043b\u0430\u043c\u0438 \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0442\u043e\u0447\u043a\u043e\u0439 \u2014 \u0438\u0445 \u0434\u0432\u043e\u0438\u0447\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435. \u041a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442 \u0432\u0441\u0435 \u0441\u0432\u043e\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0432 \u0434\u0432\u043e\u0438\u0447\u043d\u043e\u043c \u0432\u0438\u0434\u0435. \u0418 \u0434\u043b\u044f \u0446\u0435\u043b\u044b\u0445 \u0447\u0438\u0441\u0435\u043b \u044d\u0442\u0430 \u0434\u0432\u043e\u0438\u0447\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442. \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0434\u0435\u0441\u044f\u0442\u0438\u0447\u043d\u044b\u0435 \u0447\u0438\u0441\u043b\u0430. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u0430\u043d\u0433\u043b\u043e\u044f\u0437\u044b\u0447\u043d\u044b\u0445 \u0441\u0442\u0440\u0430\u043d\u0430\u0445, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a \u0410\u0432\u0441\u0442\u0440\u0430\u043b\u0438\u044f, \u043c\u044b \u043f\u0438\u0448\u0435\u043c \u0434\u0435\u0441\u044f\u0442\u0438\u0447\u043d\u044b\u0435 \u0447\u0438\u0441\u043b\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/6c4\/cf8\/0fa\/6c4cf80fa1e38d06d79ca6ad846fa741.svg\" alt=\"$3.1415926$\" data-tex=\"display\"><\/math><\/p>\n<p>  \u0427\u0430\u0441\u0442\u044c \u0441\u043b\u0435\u0432\u0430 \u043e\u0442 \u0442\u043e\u0447\u0435\u043a (\u2026 ) \u2014 \u044d\u0442\u043e \u0446\u0435\u043b\u0430\u044f \u0447\u0430\u0441\u0442\u044c, \u0430 \u0441\u043f\u0440\u0430\u0432\u0430 \u043e\u0442 \u0442\u043e\u0447\u043a\u0438 \u2014 \u0434\u0440\u043e\u0431\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c. \u041d\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0447\u0438\u0441\u043b\u0430 \u0438\u043c\u0435\u044e\u0442 \u0434\u0440\u043e\u0431\u043d\u044b\u0435 \u0447\u0430\u0441\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435\u043b\u0435\u0433\u043a\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u043d\u0430 \u0434\u0432\u0435. \u0422\u0430\u043a \u0447\u0442\u043e \u0438\u0445 \u0442\u0440\u0443\u0434\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432 \u0434\u0432\u043e\u0438\u0447\u043d\u043e\u043c \u0432\u0438\u0434\u0435. \u041d\u043e \u0442\u0430 \u0436\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043f\u0440\u0438 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0438 10. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u0440\u043e\u0431\u044c 10\/9. \u041c\u043e\u0436\u043d\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u0432\u0440\u043e\u0434\u0435 \u044d\u0442\u043e\u0433\u043e:<\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/add\/feb\/6ea\/addfeb6ea67ee409d306b3e37773fb0a.svg\" alt=\"$1.111111111111111111111111111111111111.11111111111111111111111111111111111$\" data-tex=\"display\"><\/math><\/p>\n<p>  \u041e\u0434\u043d\u0430\u043a\u043e \u044d\u0442\u043e \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0435\u043d\u0438\u0435. \u0427\u0442\u043e\u0431\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c 10\/9 \u0442\u043e\u0447\u043d\u043e, \u0435\u0434\u0438\u043d\u0438\u0446\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u044b\u043c\u0438. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a\u0443\u044e-\u0442\u043e \u0434\u0440\u0443\u0433\u0443\u044e \u043d\u043e\u0442\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0449\u0438\u0445\u0441\u044f. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u0430\u043a\u0443\u044e:<\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/2a7\/6a5\/d09\/2a76a5d0953d96053607d413655a8165.svg\" alt=\"$1.\\dot{1}$\" data-tex=\"display\"><\/math><\/p>\n<p>  \u042d\u0442\u0430 \u0442\u043e\u0447\u043a\u0430 \u043d\u0430\u0434 \u0435\u0434\u0438\u043d\u0438\u0446\u0435\u0439 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0435\u0434\u0438\u043d\u0438\u0446\u044b \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u044e\u0442\u0441\u044f. \u041d\u043e \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u044f\u0437\u044b\u043a\u043e\u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u043d\u0435\u0442.<\/p>\n<p>  \u0417\u0430\u043c\u0435\u0442\u044c\u0442\u0435, \u0447\u0442\u043e 10\/9 \u0438\u043c\u0435\u0435\u0442 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u0443\u044e \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c. \u0418 \u0432\u0441\u0451, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0434\u043b\u044f \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438, \u2014 \u044d\u0442\u043e \u0434\u0432\u0430 \u043a\u0443\u0441\u043e\u0447\u043a\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438. \u042d\u0442\u043e <i>\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c<\/i> \u0438 <i>\u0437\u043d\u0430\u043c\u0435\u043d\u0430\u0442\u0435\u043b\u044c<\/i>. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u0434\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f BigInt \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0446\u0435\u043b\u044b\u0435 \u0447\u0438\u0441\u043b\u0430. \u041d\u043e \u0435\u0441\u043b\u0438 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c <i>\u043f\u0430\u0440\u0443<\/i> \u0438\u0437 \u0446\u0435\u043b\u044b\u0445 \u0447\u0438\u0441\u0435\u043b, \u0442\u043e \u0441\u043c\u043e\u0436\u0435\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u0435 <i>\u0438\u043b\u0438<\/i> \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0435 \u0447\u0438\u0441\u043b\u0430.<\/p>\n<p>  \u0412 JavaScript \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"javascript\">\/\/ file: ratio.js export default class Ratio {   \/\/ We expect n and d to be BigInt values.   constructor(n, d) {     this.numerator = n;     this.denominator = d;   } }<\/code><\/pre>\n<p>  \u0418\u0442\u0430\u043a, \u043c\u044b \u043f\u0440\u043e\u0434\u0435\u043b\u0430\u043b\u0438 \u0441\u0430\u043c\u0443\u044e \u0445\u0438\u0442\u0440\u0443\u044e \u0447\u0430\u0441\u0442\u044c. \u00ab\u0418\u0437\u043e\u0431\u0440\u0435\u043b\u0438\u00bb \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0447\u0438\u0441\u0435\u043b \u0441 \u043f\u043e\u0447\u0442\u0438 \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e. (\u041c\u044b \u0432\u0441\u0435 \u0435\u0449\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u044b \u043e\u0431\u044a\u0435\u043c\u043e\u043c \u043f\u0430\u043c\u044f\u0442\u0438 \u043d\u0430\u0448\u0438\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432.) \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0443. \u0422\u0430\u043a \u0447\u0442\u043e \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>  <font color=\"#09b744\"><\/p>\n<h2>\u0420\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u043e<\/h2>\n<p><\/font><br \/>  \u041f\u0435\u0440\u0432\u043e\u0435, \u0447\u0442\u043e \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u2014 \u044d\u0442\u043e \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u0434\u0432\u0435 \u0434\u0440\u043e\u0431\u0438. \u0417\u0430\u0447\u0435\u043c? \u041f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u043c\u043d\u0435 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f <a href=\"https:\/\/jrsinclair.com\/articles\/2016\/one-weird-trick-that-will-change-the-way-you-code-forever-javascript-tdd\/\">\u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u044b<\/a>. \u0415\u0441\u043b\u0438 \u044f \u043c\u043e\u0433\u0443 \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u0434\u0432\u0435 \u0434\u0440\u043e\u0431\u0438 \u043d\u0430 \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u043e, \u0442\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u044b \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0449\u0435.<\/p>\n<p>  \u0412 \u043f\u0440\u043e\u0441\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u0430 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043b\u0435\u0433\u043a\u043e:<\/p>\n<pre><code class=\"javascript\">\/\/ file: ratio.js export default class Ratio {   constructor(n, d) {     this.numerator = n;     this.denominator = d;   }    equals(other) {     return (       this.numerator === other.numerator &amp;&amp;       this.denominator === other.denominator     );   } }<\/code><\/pre>\n<p>  \u0412\u043e\u0442 \u0438 \u0445\u043e\u0440\u043e\u0448\u043e. \u041d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u043d\u0435\u043f\u043b\u043e\u0445\u043e, \u0435\u0441\u043b\u0438 \u0431\u044b \u043d\u0430\u0448\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043c\u043e\u0433\u043b\u0430 \u0441\u043e\u043e\u0431\u0449\u0438\u0442\u044c, \u0447\u0442\u043e 1\/2 \u0440\u0430\u0432\u043d\u0430 2\/4. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0434\u0440\u043e\u0431\u044c. \u0422\u043e \u0435\u0441\u0442\u044c, \u043f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u043e, \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c \u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u0438 \u0438 \u0437\u043d\u0430\u043c\u0435\u043d\u0430\u0442\u0435\u043b\u0438 \u043e\u0431\u0435\u0438\u0445 \u0434\u0440\u043e\u0431\u0435\u0439 \u0434\u043e \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0431\u043e\u043b\u0435\u0435 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0445 \u0447\u0438\u0441\u0435\u043b. \u0418\u0442\u0430\u043a, \u043a\u0430\u043a \u043c\u044b \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u044d\u0442\u043e?<\/p>\n<p>  \u041d\u0430\u0438\u0432\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u043f\u0440\u043e\u0433\u043e\u043d\u0435 \u0432\u0441\u0435\u0445 \u0447\u0438\u0441\u0435\u043b \u043e\u0442 1 \u0434\u043e min(n,d) (\u0433\u0434\u0435 nn \u0438 dd \u2014 \u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c \u0438 \u0437\u043d\u0430\u043c\u0435\u043d\u0430\u0442\u0435\u043b\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e). \u0418 \u044d\u0442\u043e \u0442\u043e, \u0447\u0442\u043e \u044f \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b \u0432\u043d\u0430\u0447\u0430\u043b\u0435. \u041a\u043e\u0434 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b \u043a\u0430\u043a-\u0442\u043e \u0442\u0430\u043a:<\/p>\n<pre><code class=\"javascript\">function simplify(numerator, denominator) {     const maxfac = Math.min(numerator, denominator);     for (let i=2; i&lt;=maxfac; i++) {       if ((numerator % i === 0) &amp;&amp; (denominator % i === 0)) {         return simplify(numerator \/ i, denominator \/ i);       }     }     return Ratio(numerator, denominator); }<\/code><\/pre>\n<p>  \u0418, \u043a\u0430\u043a \u0438 \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043b\u043e \u043e\u0436\u0438\u0434\u0430\u0442\u044c, \u043e\u043d \u043d\u0435\u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u0439. \u041c\u043e\u0438 \u0442\u0435\u0441\u0442\u044b \u0437\u0430\u043d\u044f\u043b\u0438 \u0432\u0435\u0447\u043d\u043e\u0441\u0442\u044c. \u0422\u0430\u043a \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u0431\u043e\u043b\u0435\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434. \u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u0433\u0440\u0435\u0447\u0435\u0441\u043a\u0438\u0439 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a \u043d\u0430\u0448\u0435\u043b \u0435\u0433\u043e \u043f\u0430\u0440\u0443 \u0442\u044b\u0441\u044f\u0447\u0435\u043b\u0435\u0442\u0438\u0439 \u043d\u0430\u0437\u0430\u0434. \u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u2014 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0415\u0432\u043a\u043b\u0438\u0434\u0430. \u042d\u0442\u043e \u0441\u043f\u043e\u0441\u043e\u0431 \u043d\u0430\u0439\u0442\u0438 \u043d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0438\u0439 \u043e\u0431\u0449\u0438\u0439 \u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c \u0434\u0432\u0443\u0445 \u0446\u0435\u043b\u044b\u0445 \u0447\u0438\u0441\u0435\u043b.<\/p>\n<p>  \u0420\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0415\u0432\u043a\u043b\u0438\u0434\u0430 \u043a\u0440\u0430\u0441\u0438\u0432\u0430 \u0438 \u044d\u043b\u0435\u0433\u0430\u043d\u0442\u043d\u0430:<\/p>\n<pre><code class=\"javascript\">function gcd(a, b) {     return (b === 0) ? a : gcd(b, a % b); }<\/code><\/pre>\n<p>  \u041f\u0440\u0438\u043c\u0435\u043d\u0438\u043c\u0430 \u043c\u0435\u043c\u043e\u0438\u0437\u0430\u0446\u0438\u044f, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u0438\u0432\u043b\u0435\u043a\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c. \u041d\u043e, \u0443\u0432\u044b, <a href=\"https:\/\/kangax.github.io\/compat-table\/es6\/#test-proper_tail_calls_(tail_call_optimisation)\">\u0443 \u043d\u0430\u0441 \u0435\u0449\u0435 \u043d\u0435\u0442 \u0445\u0432\u043e\u0441\u0442\u043e\u0432\u043e\u0439 \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0438 \u0432 V8 \u0438\u043b\u0438 SpiderMonkey<\/a>. (\u041f\u043e \u043a\u0440\u0430\u0439\u043d\u0435\u0439 \u043c\u0435\u0440\u0435 \u043d\u0435 \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438.) \u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u043c\u044b \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0435\u0433\u043e \u0441 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u043c\u0438 \u0446\u0435\u043b\u044b\u043c\u0438 \u0447\u0438\u0441\u043b\u0430\u043c\u0438, \u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0441\u0442\u0435\u043a\u0430. \u0410 \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0446\u0435\u043b\u044b\u0435 \u0447\u0438\u0441\u043b\u0430 \u2014 \u044d\u0442\u043e \u0447\u0442\u043e-\u0442\u043e \u0432\u0440\u043e\u0434\u0435 \u0442\u043e\u0447\u043a\u0438 \u043e\u0442\u0441\u0447\u0451\u0442\u0430.<\/p>\n<p>  \u0422\u0430\u043a \u0447\u0442\u043e \u0432\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0439:<\/p>\n<pre><code class=\"javascript\">\/\/ file: ratio.js function gcd(a, b) {     let t;     while (b !== 0) {         t = b;         b = a % b;         a = t;     }     return a; }<\/code><\/pre>\n<p>  \u041d\u0435 \u0442\u0430\u043a \u044d\u043b\u0435\u0433\u0430\u043d\u0442\u043d\u043e, \u043d\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u0441\u0432\u043e\u044e \u0440\u0430\u0431\u043e\u0442\u0443. \u0418 \u0441 \u044d\u0442\u0438\u043c \u043a\u043e\u0434\u043e\u043c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0434\u043b\u044f \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f \u0434\u0440\u043e\u0431\u0435\u0439. \u041f\u043e\u043a\u0430 \u043c\u044b \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u043c, \u043c\u044b \u0432\u043d\u0435\u0441\u0451\u043c \u0438 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435, \u0447\u0442\u043e\u0431\u044b \u0437\u043d\u0430\u043c\u0435\u043d\u0430\u0442\u0435\u043b\u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u044b\u043b\u0438 \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 (\u0442. \u0435. \u0434\u043b\u044f \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b \u0437\u043d\u0430\u043a \u043c\u0435\u043d\u044f\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c).<\/p>\n<pre><code class=\"javascript\">\/\/ file: ratio.js  function sign(x) {   return x === BigInt(0) ? BigInt(0)        : x &gt; BigInt(0)   ? BigInt(1)         \/* otherwise *\/   : BigInt(-1); }  function abs(x) {   return x &lt; BigInt(0) ? x * BigInt(-1) : x; }  function simplify(numerator, denominator) {   const sgn = sign(numerator) * sign(denominator);   const n = abs(numerator);   const d = abs(denominator);   const f = gcd(n, d);   return new Ratio((sgn * n) \/ f, d \/ f); } <\/code><\/pre>\n<p>  \u0418 \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0430\u0448 \u043c\u0435\u0442\u043e\u0434 \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u0430:<\/p>\n<pre><code class=\"javascript\">\/\/ file: ratio.js -- inside the class declaration   equals(other) {     const a = simplify(this);     const b = simplify(other);     return (       a.numerator === b.numerator &amp;&amp;       a.denominator === b.denominator     );   } <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u0434\u0432\u0435 \u0434\u0440\u043e\u0431\u0438 \u043d\u0430 \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u043e. \u041c\u043e\u0436\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u044d\u0442\u043e \u043d\u0435 \u0442\u0430\u043a \u0443\u0436 \u0438 \u043c\u043d\u043e\u0433\u043e, \u043d\u043e \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u044e\u043d\u0438\u0442-\u0442\u0435\u0441\u0442\u044b \u0438 \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043d\u0430\u0448\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043a\u0430\u043a \u043e\u0436\u0438\u0434\u0430\u0435\u0442\u0441\u044f.<\/p>\n<p>  <font color=\"#09b744\"><\/p>\n<h2>\u041f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 \u0434\u0440\u0443\u0433\u0438\u0435 \u0442\u0438\u043f\u044b<\/h2>\n<p><\/font><br \/>  \u041d\u0435 \u0431\u0443\u0434\u0443 \u0443\u0442\u043e\u043c\u043b\u044f\u0442\u044c, \u0432\u044b\u043f\u0438\u0441\u044b\u0432\u0430\u044f \u0432\u0441\u0435 \u044e\u043d\u0438\u0442-\u0442\u0435\u0441\u0442\u044b \u043c\u043e\u0435\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u041d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u043d\u0435\u043f\u043b\u043e\u0445\u043e \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0440\u043e\u0431\u0438 \u0432 \u0434\u0440\u0443\u0433\u0438\u0435 \u0444\u043e\u0440\u043c\u0430\u0442\u044b. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0437\u0430\u0445\u043e\u0442\u0435\u0442\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0438\u0445 \u043a\u0430\u043a \u0441\u0442\u0440\u043e\u043a\u0443 \u0432 \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u044b\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u0445. \u0418\u043b\u0438, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043c\u044b \u0437\u0430\u0445\u043e\u0442\u0438\u043c \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u0432 \u0447\u0438\u0441\u043b\u0430. \u0418\u0442\u0430\u043a, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u043c\u0435\u0442\u043e\u0434\u044b .toString() \u0438 .toValue() \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430.<\/p>\n<p>  \u041c\u0435\u0442\u043e\u0434 .toString() \u043f\u0440\u043e\u0449\u0435 \u0432\u0441\u0435\u0433\u043e, \u0442\u0430\u043a \u0447\u0442\u043e \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0430\u0447\u043d\u0451\u043c \u0441 \u043d\u0435\u0433\u043e.<\/p>\n<pre><code class=\"javascript\">\/\/ file: ratio.js -- inside the class declaration   toString() {     return `${this.numerator}\/${this.denominator}`;   }<\/code><\/pre>\n<p>  \u0414\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e. \u041d\u043e \u043a\u0430\u043a \u043d\u0430\u0441\u0447\u0451\u0442 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0432 \u0447\u0438\u0441\u043b\u043e? \u041e\u0434\u0438\u043d \u0438\u0437 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u2014 \u043f\u0440\u043e\u0441\u0442\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c \u043d\u0430 \u0437\u043d\u0430\u043c\u0435\u043d\u0430\u0442\u0435\u043b\u044c:<\/p>\n<pre><code class=\"javascript\">\/\/ file: ratio.js -- inside the class declaration   toValue() {     return  Number(this.numerator) \/ Number(this.denominator);   }<\/code><\/pre>\n<p>  \u0417\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u041d\u043e, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043c\u044b \u0437\u0430\u0445\u043e\u0442\u0438\u043c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u0434. \u0412\u0435\u0441\u044c \u0441\u043c\u044b\u0441\u043b \u043d\u0430\u0448\u0435\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0446\u0435\u043b\u044b\u0435 \u0447\u0438\u0441\u043b\u0430 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438. \u0418 \u0438\u043d\u043e\u0433\u0434\u0430 \u044d\u0442\u0438 \u0446\u0435\u043b\u044b\u0435 \u0447\u0438\u0441\u043b\u0430 \u0431\u0443\u0434\u0443\u0442 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0431\u043e\u043b\u044c\u0448\u0438\u043c\u0438, \u0447\u0442\u043e\u0431\u044b \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u043a \u0442\u0438\u043f\u0443 Number. \u041d\u043e \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c Number \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0431\u043b\u0438\u0436\u0435 \u043a \u0438\u0441\u0442\u0438\u043d\u0435, \u0433\u0434\u0435 \u044d\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e. \u0422\u0430\u043a \u0447\u0442\u043e \u043c\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439, \u043f\u043e\u043a\u0430 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u0443\u0435\u043c BigInt \u0432 Number:<\/p>\n<pre><code class=\"javascript\">\/\/ file: ratio.js -- inside the class declaration   toValue() {     const intPart = this.numerator \/ this.denominator;     return (       Number(this.numerator - intPart * this.denominator) \/         Number(this.denominator) + Number(intPart)     );   }<\/code><\/pre>\n<p>  \u0418\u0437\u0432\u043b\u0435\u043a\u0430\u044f \u0446\u0435\u043b\u0443\u044e \u0447\u0430\u0441\u0442\u044c, \u043c\u044b \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0435\u043c \u0440\u0430\u0437\u043c\u0435\u0440 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 BigInt, \u043f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u0432 Number. \u0415\u0441\u0442\u044c \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e, \u0443 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u0435\u043d\u044c\u0448\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u043e\u043c. \u0412 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043e\u043d\u0438 \u0441\u043b\u043e\u0436\u043d\u0435\u0435 \u0438 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435. \u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u044f \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0432\u0430\u043c \u0437\u0430\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u0432 \u043d\u0438\u0445 \u0433\u043b\u0443\u0431\u0436\u0435. \u041d\u043e \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043e\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u043b\u0443\u0447\u0430\u0435\u0432, \u0447\u0442\u043e\u0431\u044b \u0431\u044b\u0442\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c.<\/p>\n<p>  <font color=\"#09b744\"><\/p>\n<h2>\u0423\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u0434\u0435\u043b\u0435\u043d\u0438\u0435<\/h2>\n<p><\/font><br \/>  \u0421\u0434\u0435\u043b\u0430\u0435\u043c \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u0441 \u0447\u0438\u0441\u043b\u0430\u043c\u0438. \u041a\u0430\u043a \u043d\u0430\u0441\u0447\u0451\u0442 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0434\u0435\u043b\u0435\u043d\u0438\u044f? \u042d\u0442\u043e \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u043e \u0434\u043b\u044f \u0434\u0440\u043e\u0431\u0435\u0439. \u0423\u043c\u043d\u043e\u0436\u0430\u0435\u043c \u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u0438 \u043d\u0430 \u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u0438, \u0430 \u0437\u043d\u0430\u043c\u0435\u043d\u0430\u0442\u0435\u043b\u0438 \u043d\u0430 \u0437\u043d\u0430\u043c\u0435\u043d\u0430\u0442\u0435\u043b\u0438.<\/p>\n<pre><code class=\"javascript\">\/\/ file: ratio.js -- inside the class declaration   times(x) {     return simplify(       x.numerator * this.numerator,       x.denominator * this.denominator     );   }<\/code><\/pre>\n<p>  \u0414\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u0445\u043e\u0436\u0435 \u043d\u0430 \u043a\u043e\u0434 \u0432\u044b\u0448\u0435. \u041f\u0435\u0440\u0435\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0432\u0442\u043e\u0440\u0443\u044e \u0434\u0440\u043e\u0431\u044c, \u0437\u0430\u0442\u0435\u043c \u0443\u043c\u043d\u043e\u0436\u0430\u0435\u043c.<\/p>\n<pre><code class=\"javascript\">\/\/ file: ratio.js -- inside the class declaration   divideBy(x) {     return simplify(       this.numerator * x.denominator,       this.denominator * x.numerator     );   }<\/code><\/pre>\n<p>  <font color=\"#09b744\"><\/p>\n<h2>\u0421\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u0432\u044b\u0447\u0438\u0442\u0430\u043d\u0438\u0435<\/h2>\n<p><\/font><br \/>  \u0422\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u0434\u0435\u043b\u0435\u043d\u0438\u0435. \u041b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0432\u0435\u0449\u044c, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c, \u2014 \u044d\u0442\u043e \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u0432\u044b\u0447\u0438\u0442\u0430\u043d\u0438\u0435. \u042d\u0442\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u0435\u0435, \u0447\u0435\u043c \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u0434\u0435\u043b\u0435\u043d\u0438\u0435. \u041d\u043e \u043d\u0435 \u0441\u043b\u0438\u0448\u043a\u043e\u043c.<br \/>  \u0427\u0442\u043e\u0431\u044b \u0441\u043b\u043e\u0436\u0438\u0442\u044c \u0434\u0432\u0435 \u0434\u0440\u043e\u0431\u0438, \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u0438\u0445 \u043a \u043e\u0434\u043d\u043e\u043c\u0443 \u0437\u043d\u0430\u043c\u0435\u043d\u0430\u0442\u0435\u043b\u044e, \u0437\u0430\u0442\u0435\u043c \u0441\u043b\u043e\u0436\u0438\u0442\u044c \u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u0438. \u0412 \u043a\u043e\u0434\u0435 \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:<\/p>\n<pre><code class=\"javascript\">\/\/ file: ratio.js -- inside the class declaration   add(x) {     return simplify(       this.numerator * x.denominator + x.numerator * this.denominator,       this.denominator * x.denominator     );   }<\/code><\/pre>\n<p>  \u0412\u0441\u0451 \u0443\u043c\u043d\u043e\u0436\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0437\u043d\u0430\u043c\u0435\u043d\u0430\u0442\u0435\u043b\u0438. \u0418 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c simplify(), \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u043b\u0430\u0441\u044c \u0434\u0440\u043e\u0431\u044c \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043c\u0435\u043d\u044c\u0448\u0435 \u0432 \u0441\u043c\u044b\u0441\u043b\u0435 \u0447\u0438\u0441\u0435\u043b \u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044f \u0438 \u0437\u043d\u0430\u043c\u0435\u043d\u0430\u0442\u0435\u043b\u044f.<br \/>  \u0412\u044b\u0447\u0438\u0442\u0430\u043d\u0438\u0435 \u043f\u043e\u0445\u043e\u0436\u0435 \u043d\u0430 \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u041c\u044b \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u0438\u0440\u0443\u0435\u043c \u0434\u0432\u0443\u043c\u044f \u0434\u0440\u043e\u0431\u044f\u043c\u0438 \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0435 \u0437\u043d\u0430\u043c\u0435\u043d\u0430\u0442\u0435\u043b\u0438 \u0432\u044b\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u0432 \u0440\u044f\u0434, \u043a\u0430\u043a \u0440\u0430\u043d\u044c\u0448\u0435. \u0417\u0430\u0442\u0435\u043c \u043d\u0435 \u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u043c, \u0430 \u0432\u044b\u0447\u0438\u0442\u0430\u0435\u043c.<\/p>\n<pre><code class=\"javascript\">\/\/ file: ratio.js -- inside the class declaration   subtract(x) {     return simplify(       this.numerator * x.denominator - x.numerator * this.denominator,       this.denominator * x.denominator     );   }<\/code><\/pre>\n<p>  \u0418\u0442\u0430\u043a, \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b. \u041c\u043e\u0436\u043d\u043e \u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0442\u044c, \u0432\u044b\u0447\u0438\u0442\u0430\u0442\u044c, \u0443\u043c\u043d\u043e\u0436\u0430\u0442\u044c \u0438 \u0434\u0435\u043b\u0438\u0442\u044c. \u041d\u043e \u043d\u0430\u043c \u0432\u0441\u0451 \u0435\u0449\u0451 \u043d\u0443\u0436\u043d\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u0440\u0443\u0433\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432. \u0412 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u0446\u0438\u0444\u0440\u044b \u0438\u043c\u0435\u044e\u0442 \u0432\u0430\u0436\u043d\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e: \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c \u0438\u0445 \u0434\u0440\u0443\u0433 \u0441 \u0434\u0440\u0443\u0433\u043e\u043c.<\/p>\n<p>  <font color=\"#09b744\"><\/p>\n<h2>\u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f<\/h2>\n<p><\/font><br \/>  \u041c\u044b \u0443\u0436\u0435 \u043e\u0431\u0441\u0443\u0436\u0434\u0430\u043b\u0438 .equals(). \u041d\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043d\u0435\u0447\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u0435\u0435, \u0447\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u043e. \u041c\u044b \u0442\u0430\u043a\u0436\u0435 \u0445\u043e\u0442\u0435\u043b\u0438 \u0431\u044b \u0438\u043c\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f \u0434\u0440\u043e\u0431\u0435\u0439 \u00ab\u0431\u043e\u043b\u044c\u0448\u0435, \u043c\u0435\u043d\u044c\u0448\u0435\u00bb. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043c\u0435\u0442\u043e\u0434 .lte(), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0435\u0442 \u043d\u0430\u043c, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438 \u043e\u0434\u043d\u0430 \u0434\u0440\u043e\u0431\u044c \u043c\u0435\u043d\u044c\u0448\u0435\u0439 \u0438\u043b\u0438 \u0440\u0430\u0432\u043d\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439 \u0434\u0440\u043e\u0431\u0438. \u041a\u0430\u043a \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 .equals(), \u043d\u0435 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u043a\u0430\u043a\u0430\u044f \u0438\u0437 \u0434\u0432\u0443\u0445 \u0434\u0440\u043e\u0431\u0435\u0439 \u043c\u0435\u043d\u044c\u0448\u0435. \u0427\u0442\u043e\u0431\u044b \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u0438\u0445, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u0435 \u043a \u043e\u0434\u043d\u043e\u043c\u0443 \u0437\u043d\u0430\u043c\u0435\u043d\u0430\u0442\u0435\u043b\u044e, \u0437\u0430\u0442\u0435\u043c \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u0438. \u0421 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u043c \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u0435\u043c \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"javascript\">\/\/ file: ratio.js -- inside the class declaration   lte(other) {     const { numerator: thisN, denominator: thisD } = simplify(       this.numerator,       this.denominator     );     const { numerator: otherN, denominator: otherD } = simplify(       other.numerator,       other.denominator     );     return thisN * otherD &lt;= otherN * thisD;   } <\/code><\/pre>\n<p>  \u041a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c .lte() \u0438 .equals(), \u0442\u043e \u0441\u043c\u043e\u0436\u0435\u043c \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f. \u041c\u043e\u0436\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043b\u044e\u0431\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f. \u041d\u043e \u0435\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c equals() \u0438 &gt;, &lt;, \u2265 \u0438\u043b\u0438 \u2264, \u0442\u043e \u043c\u044b \u0441\u043c\u043e\u0436\u0435\u043c \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0431\u0443\u043b\u0435\u0432\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u0438. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u0432\u044b\u0431\u0440\u0430\u043b\u0438 lte(), \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 <a href=\"https:\/\/github.com\/fantasyland\/fantasy-land#ord\">\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442 FantasyLand<\/a>. \u0412\u043e\u0442 \u043a\u0430\u043a \u043c\u043e\u0433\u0443\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b:<\/p>\n<pre><code class=\"javascript\">\/\/ file: ratio.js -- inside the class declaration   lt(other) {     return this.lte(other) &amp;&amp; !this.equals(other);   }    gt(other) {     return !this.lte(other);   }    gte(other) {     return this.gt(other) || this.equals(other);   } <\/code><\/pre>\n<p>  <font color=\"#09b744\"><\/p>\n<h2>\u041e\u043a\u0440\u0443\u0433\u043b\u0435\u043d\u0438\u0435<\/h2>\n<p><\/font><br \/>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u0434\u0440\u043e\u0431\u0438. \u0410 \u0435\u0449\u0451 \u043c\u043e\u0436\u0435\u043c \u0443\u043c\u043d\u043e\u0436\u0430\u0442\u044c \u0438 \u0434\u0435\u043b\u0438\u0442\u044c, \u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0442\u044c \u0438 \u0432\u044b\u0447\u0438\u0442\u0430\u0442\u044c. \u041d\u043e \u0435\u0441\u043b\u0438 \u043c\u044b \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u0434\u0435\u043b\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0433\u043e \u0441 \u043d\u0430\u0448\u0435\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432. \u0423\u0434\u043e\u0431\u043d\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b JavaScript Math \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u043c\u0435\u0442\u043e\u0434\u044b .floor() \u0438 .ceil().<br \/>  \u041d\u0430\u0447\u043d\u0451\u043c \u0441 .floor(). Floor \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438 \u043e\u043a\u0440\u0443\u0433\u043b\u044f\u0435\u0442 \u0435\u0433\u043e \u0432\u043d\u0438\u0437. \u041f\u0440\u0438 \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0447\u0438\u0441\u043b\u0430\u0445 \u044d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0446\u0435\u043b\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0438 \u043e\u0442\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u043c \u043e\u0441\u0442\u0430\u0432\u0448\u0443\u044e\u0441\u044f \u0447\u0430\u0441\u0442\u044c. \u041d\u043e \u0434\u043b\u044f \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b \u043c\u044b \u043e\u043a\u0440\u0443\u0433\u043b\u044f\u0435\u043c \u0432\u0432\u0435\u0440\u0445 \u043e\u0442 \u043d\u0443\u043b\u044f, \u0442\u0430\u043a \u0447\u0442\u043e \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0447\u0438\u0441\u043b\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0443\u0434\u0435\u043b\u0438\u0442\u044c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f.<\/p>\n<pre><code class=\"javascript\">\/\/ file: ratio.js -- inside the class declaration   floor() {     const one = new Ratio(BigInt(1), BigInt(0));     const trunc = simplify(this.numerator \/ this.denominator, BigInt(1));     if (this.gte(one) || trunc.equals(this)) {       return trunc;     }     return trunc.minus(one);   }<\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434 \u0432\u044b\u0448\u0435, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043e\u043a\u0440\u0443\u0433\u043b\u0435\u043d\u043d\u044b\u0435 \u0432\u0432\u0435\u0440\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f.<\/p>\n<pre><code class=\"javascript\">\/\/ file: ratio.js -- inside the class declaration   ceil() {     const one = new Ratio(BigInt(1), BigInt(0));     return this.equals(this.floor()) ? this : this.floor().add(one);   }<\/code><\/pre>\n<p>  \u0421\u0435\u0439\u0447\u0430\u0441 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0433\u043e \u0434\u043b\u044f \u043c\u043d\u043e\u0433\u0438\u0445 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439. \u0410 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e .toValue() \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043b\u0435\u0433\u043a\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0432 \u0434\u0435\u0441\u044f\u0442\u0438\u0447\u043d\u044b\u0435 \u0447\u0438\u0441\u043b\u0430. \u041d\u043e \u0447\u0442\u043e, \u0435\u0441\u043b\u0438 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u0447\u0438\u0441\u043b\u043e \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0442\u043e\u0447\u043a\u043e\u0439 \u0432 \u0434\u0440\u043e\u0431\u044c?<\/p>\n<p>  <font color=\"#09b744\"><\/p>\n<h2>\u0427\u0438\u0441\u043b\u043e \u0432 \u0434\u0440\u043e\u0431\u044c<\/h2>\n<p><\/font><br \/>  \u041f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0447\u0438\u0441\u0435\u043b \u0432 \u0434\u0440\u043e\u0431\u0438 \u0441\u043b\u043e\u0436\u043d\u0435\u0435, \u0447\u0435\u043c \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434. \u0418 \u0435\u0441\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u043f\u0440\u043e\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435. \u041c\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0435 \u0441\u0430\u043c\u044b\u0439 \u0442\u043e\u0447\u043d\u044b\u0439, \u043d\u043e \u043e\u043d \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0445\u043e\u0440\u043e\u0448. \u0427\u0442\u043e\u0431\u044b \u043e\u043d \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u043b, \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0447\u0438\u0441\u043b\u043e \u0432 \u0441\u0442\u0440\u043e\u043a\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f, \u043a\u0430\u043a \u043c\u044b \u0437\u043d\u0430\u0435\u043c, \u043f\u0440\u0438\u043e\u0431\u0440\u0435\u0442\u0451\u0442 \u0444\u043e\u0440\u043c\u0430\u0442 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e JavaScript \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u043c\u0435\u0442\u043e\u0434 .toExponential(). \u041c\u0435\u0442\u043e\u0434 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0447\u0438\u0441\u043b\u043e \u0432 \u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u043d\u043e\u0442\u0430\u0446\u0438\u0438. \u0412\u043e\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0434\u043b\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0438\u0434\u0435\u0438:<\/p>\n<pre><code class=\"javascript\">let x = 12.345; console.log(x.toExponential(5)); \/\/ \u2998 '1.23450e+1''  x = 0.000000000042; console.log(x.toExponential(3)); \/\/ \u2998 '4.200e-11'  x = 123456789; console.log(x.toExponential(4)); \/\/ \u2998 '1.2346e+8' <\/code><\/pre>\n<p>  \u041a\u043e\u0434 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044f \u0447\u0438\u0441\u043b\u043e \u0432 \u0432\u0438\u0434\u0435 \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0434\u0435\u0441\u044f\u0442\u0438\u0447\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438 \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u044f. \u041d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0434\u0435\u0441\u044f\u0442\u0438\u0447\u043d\u044b\u0439 \u0431\u0438\u0442 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043c\u0430\u043d\u0442\u0438\u0441\u0441\u043e\u0439, \u0430 \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u044c \u2014 \u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0439. \u0417\u0434\u0435\u0441\u044c \u00ab\u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439\u00bb \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043c\u0430\u043d\u0442\u0438\u0441\u0441\u044b \u0432\u0441\u0435\u0433\u0434\u0430 \u043c\u0435\u043d\u044c\u0448\u0435 10. \u0410 \u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u0432\u0441\u0435\u0433\u0434\u0430 \u0442\u0435\u043f\u0435\u0440\u044c 10. \u041c\u044b \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043d\u0430\u0447\u0430\u043b\u043e \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u044f \u0441 \u0431\u0443\u043a\u0432\u043e\u0439 &#8216;e&#8217; (\u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043e\u0442 &#8216;exponent&#8217;).<\/p>\n<p>  \u041f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e \u044d\u0442\u043e\u0439 \u043d\u043e\u0442\u0430\u0446\u0438\u0438 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043e\u043d\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u0430. \u0412\u0441\u0435\u0433\u0434\u0430 \u0435\u0441\u0442\u044c \u0440\u043e\u0432\u043d\u043e \u043e\u0434\u043d\u0430 \u0446\u0438\u0444\u0440\u0430 \u0441\u043b\u0435\u0432\u0430 \u043e\u0442 \u0434\u0435\u0441\u044f\u0442\u0438\u0447\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438. \u0410 .toExponential() \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u044c, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0437\u043d\u0430\u0447\u0430\u0449\u0438\u0445 \u0446\u0438\u0444\u0440 \u043c\u044b \u0445\u043e\u0442\u0438\u043c. \u0417\u0430\u0442\u0435\u043c \u0438\u0434\u0435\u0442 &#8216;e&#8217; \u0438 \u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u2014 \u0432\u0441\u0435\u0433\u0434\u0430 \u0446\u0435\u043b\u043e\u0435 \u0447\u0438\u0441\u043b\u043e. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0433\u043b\u043e\u0435 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c \u0435\u0433\u043e.<\/p>\n<p>  \u041f\u0440\u043e\u0446\u0435\u0441\u0441 \u0438\u0434\u0451\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a. \u041a\u0430\u043a \u0443\u0436\u0435 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043b\u043e\u0441\u044c, .toExponential() \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0434\u043b\u044f \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0437\u043d\u0430\u0447\u0430\u0449\u0438\u0445 \u0446\u0438\u0444\u0440. \u041d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c \u0446\u0438\u0444\u0440. \u0418\u0442\u0430\u043a, \u043c\u044b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u043d\u0430 100 (\u0441\u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e JavaScript-\u0434\u0432\u0438\u0436\u043a\u043e\u0432). \u0412 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435, \u043e\u0434\u043d\u0430\u043a\u043e, \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u0440\u0438\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 10. \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0447\u0438\u0441\u043b\u043e 0.987654321e0. \u041c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438 \u0434\u0435\u0441\u044f\u0442\u0438\u0447\u043d\u0443\u044e \u0442\u043e\u0447\u043a\u0443 \u043d\u0430 10 \u0446\u0438\u0444\u0440 \u0432\u043f\u0440\u0430\u0432\u043e. \u042d\u0442\u043e \u0434\u0430\u043b\u043e \u0431\u044b \u043d\u0430\u043c 9876543210. \u0417\u0430\u0442\u0435\u043c \u0434\u0435\u043b\u0438\u043c \u043d\u0430 10^10, \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c 9876543210\/100000000. \u042d\u0442\u043e, \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u0434\u043e 987654321\/100000000.<\/p>\n<p>  \u041d\u043e \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u044d\u0442\u0443 \u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0442\u0443. \u0415\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0447\u0438\u0441\u043b\u043e \u0432\u0440\u043e\u0434\u0435 0.987654321e9, \u0442\u043e \u043c\u044b \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u0441\u0434\u0432\u0438\u043d\u0435\u043c \u0434\u0435\u0441\u044f\u0442\u0438\u0447\u043d\u0443\u044e \u0442\u043e\u0447\u043a\u0443 \u043d\u0430 10 \u0446\u0438\u0444\u0440 \u0432\u043f\u0440\u0430\u0432\u043e. \u041d\u043e \u043c\u044b \u0434\u0435\u043b\u0438\u043c \u043d\u0430 \u0434\u0435\u0441\u044f\u0442\u044c, \u043a \u0441\u0442\u0435\u043f\u0435\u043d\u0438 10-9=1.<\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d2e\/251\/984\/d2e25198426784a3f3ad912f2e403177.svg\" alt=\"$0.987654321\u00d710^9 = 9876543210\/ 10^1=$\" data-tex=\"display\"><\/math><\/p>\n<p>  <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/04c\/f21\/0df\/04cf210df60660bd26dacfec68c07eac.svg\" alt=\"$987654321\/1$\" data-tex=\"display\"><\/math><\/p>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0432\u0441\u0451 \u0431\u044b\u043b\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a, \u043c\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043b\u0438 \u043f\u0430\u0440\u0443 \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439:<\/p>\n<pre><code class=\"javascript\">\/\/ Transform a \u2018+\u2019 or \u2018-\u2018 character to +1 or -1 function pm(c) {   return parseFloat(c + &quot;1&quot;); }  \/\/ Create a new bigint of 10^n. This turns out to be a bit \/\/ faster than multiplying. function exp10(n) {   return BigInt(`1${[...new Array(n)].map(() =&gt; 0).join(&quot;&quot;)}`); }<\/code><\/pre>\n<p>  \u0421 \u0438\u0445 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0432\u0441\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e fromNumber() \u0432\u043e\u0435\u0434\u0438\u043d\u043e.<\/p>\n<pre><code class=\"javascript\">\/\/ file: ratio.js -- inside the class declaration   static fromNumber(x) {     const expParse = \/(-?\\d)\\.(\\d+)e([-+])(\\d+)\/;     const [, n, decimals, sgn, pow] =       x.toExponential(PRECISION).match(expParse) || [];     const exp = PRECISION - pm(sgn) * +pow;     return exp &lt; 0       ? simplify(BigInt(`${n}${decimals}`) * exp10(-1 * exp), BigInt(1))       : simplify(BigInt(`${n}${decimals}`), exp10(exp));   } <\/code><\/pre>\n<p>  \u041e\u0445\u0432\u0430\u0447\u0435\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439. \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043e\u0442 \u0447\u0438\u0441\u0435\u043b \u043a \u0434\u0440\u043e\u0431\u044f\u043c \u0438 \u043e\u0431\u0440\u0430\u0442\u043d\u043e. \u041d\u043e \u0434\u043b\u044f \u043c\u043e\u0435\u0433\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u043e\u043b\u044c\u0448\u0435\u0435. \u0412 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043d\u0430\u0439\u0442\u0438 \u0432\u043e\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0432 \u0441\u0442\u0435\u043f\u0435\u043d\u044c \u0438 \u043b\u043e\u0433\u0430\u0440\u0438\u0444\u043c\u044b.<\/p>\n<p>  <font color=\"#09b744\"><\/p>\n<h2>\u0412\u043e\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0432 \u0441\u0442\u0435\u043f\u0435\u043d\u044c<\/h2>\n<p><\/font><br \/>  \u0412\u043e\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0432 \u0441\u0442\u0435\u043f\u0435\u043d\u044c \u2014 \u044d\u0442\u043e \u043a\u043e\u0433\u0434\u0430 \u0447\u0438\u0441\u043b\u043e \u043c\u043d\u043e\u0433\u043e\u043a\u0440\u0430\u0442\u043d\u043e \u0443\u043c\u043d\u043e\u0436\u0430\u0435\u0442\u0441\u044f \u0441\u0430\u043c\u043e \u043d\u0430 \u0441\u0435\u0431\u044f. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, 2^3=2\u00d72\u00d72=8. \u0414\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432, \u043a\u043e\u0433\u0434\u0430 \u0441\u0442\u0435\u043f\u0435\u043d\u044c \u2014 \u0446\u0435\u043b\u043e\u0435 \u0447\u0438\u0441\u043b\u043e, \u0435\u0441\u0442\u044c \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 BigInt: **. \u0422\u0430\u043a \u0447\u0442\u043e, \u0435\u0441\u043b\u0438 \u043c\u044b \u0432\u043e\u0437\u0432\u043e\u0434\u0438\u043c \u0432 \u0441\u0442\u0435\u043f\u0435\u043d\u044c \u0434\u0440\u043e\u0431\u044c, \u044d\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442. \u0412\u043e\u0442 \u0442\u0430\u043a \u0434\u0440\u043e\u0431\u044c \u0432\u043e\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0441\u0442\u0435\u043f\u0435\u043d\u044c:  <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/21e\/cb8\/aee\/21ecb8aee9b45113941d8d248613b29c.svg\" alt=\"$\\left(\\frac{x}{y}\\right)^{n} = \\frac{x^n}{y^n}$\" data-tex=\"display\"><\/math><\/p>\n<p>  \u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043f\u0435\u0440\u0432\u044b\u0439 \u043e\u0442\u0440\u0435\u0437\u043e\u043a \u043d\u0430\u0448\u0435\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u0432\u043e\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0432 \u0441\u0442\u0435\u043f\u0435\u043d\u044c \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:<\/p>\n<pre><code class=\"javascript\">\/\/ file: ratio.js -- inside the class declaration   pow(exponent) {     if (exponent.denominator === BigInt(1)) {         return simplify(             this.numerator ** exponent.numerator,             this.denominator ** exponent.numerator         );     }   }<\/code><\/pre>\n<p>  \u041f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u041d\u0443\u2026 \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0445\u043e\u0440\u043e\u0448\u043e. \u0422\u0435\u043f\u0435\u0440\u044c \u0432\u0441\u0451 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0441\u043b\u043e\u0436\u043d\u0435\u0435. \u0418\u0437-\u0437\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u043e\u0432 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f \u0438 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0438 \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u043e\u0439\u0442\u0438 \u043d\u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043a\u043e\u043c\u043f\u0440\u043e\u043c\u0438\u0441\u0441\u044b. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u043f\u043e\u0436\u0435\u0440\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e \u0440\u0430\u0434\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043e\u0442\u0432\u0435\u0442\u0430 \u0432 \u0440\u0430\u0437\u0443\u043c\u043d\u044b\u0435 \u0441\u0440\u043e\u043a\u0438.<\/p>\n<p>  \u0412\u043e\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0432 \u0441\u0442\u0435\u043f\u0435\u043d\u044c \u043b\u0435\u0433\u043a\u043e \u043f\u043e\u0440\u043e\u0436\u0434\u0430\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0447\u0438\u0441\u043b\u0430. \u0418 \u043a\u043e\u0433\u0434\u0430 \u0447\u0438\u0441\u043b\u0430 \u0441\u0442\u0430\u043d\u043e\u0432\u044f\u0442\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u043c\u0438, \u0432\u0441\u0451 \u0437\u0430\u043c\u0435\u0434\u043b\u044f\u0435\u0442\u0441\u044f. \u041f\u043e\u043a\u0430 \u044f \u043f\u0438\u0441\u0430\u043b \u044d\u0442\u0443 \u0441\u0442\u0430\u0442\u044c\u044e, \u044f \u0442\u0430\u043a\u0436\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435, \u043d\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u044f\u0441\u044c, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0438\u0441\u044c \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u0434\u043d\u0435\u0439. \u0422\u0430\u043a \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u043e\u0441\u0442\u043e\u0440\u043e\u0436\u043d\u043e\u0441\u0442\u044c. \u041d\u043e \u043d\u0438\u0447\u0435\u0433\u043e \u0441\u0442\u0440\u0430\u0448\u043d\u043e\u0433\u043e. \u0412\u0441\u0435 \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u043b\u044f BigInt.<\/p>\n<p>  \u041d\u043e \u0435\u0441\u0442\u044c \u0438 \u0434\u0440\u0443\u0433\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430. \u0427\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c, \u0435\u0441\u043b\u0438 \u0437\u043d\u0430\u043c\u0435\u043d\u0430\u0442\u0435\u043b\u044c \u0441\u0442\u0435\u043f\u0435\u043d\u0438 \u2014 \u043d\u0435 \u0435\u0434\u0438\u043d\u0438\u0446\u0430? \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0447\u0442\u043e, \u0435\u0441\u043b\u0438 \u0431\u044b \u043c\u044b \u0445\u043e\u0442\u0435\u043b\u0438 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u0442\u044c 8^(2\/3)?<\/p>\n<p>  \u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u043d\u0430 \u0434\u0432\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043f\u043e\u043c\u0435\u043d\u044c\u0448\u0435. \u041c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043e\u0434\u043d\u0443 \u0434\u0440\u043e\u0431\u044c \u043a \u0441\u0442\u0435\u043f\u0435\u043d\u0438 \u0434\u0440\u0443\u0433\u043e\u0439. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u0442\u043d\u0435\u0441\u0442\u0438 x\/y \u043a a\/b. \u0417\u0430\u043a\u043e\u043d\u044b \u0432\u043e\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0432 \u0441\u0442\u0435\u043f\u0435\u043d\u044c \u0433\u043b\u0430\u0441\u044f\u0442, \u0447\u0442\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u043d\u043e:  <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/494\/aa5\/4ce\/494aa54cecf33ffaa1e4bf2d56ad535b.svg\" alt=\"$\\left(\\frac{x}{y}\\right)^\\frac{a}{b} = \\left(\\left(\\frac{x}{y}\\right)^\\frac{1}{b}\\right)^a = \\left(\\frac{x^\\frac{1}{b}}{y^\\frac{1}{b}}\\right)^a$\" data-tex=\"display\"><\/math><\/p>\n<p>  \u041c\u044b \u0443\u0436\u0435 \u0437\u043d\u0430\u0435\u043c, \u043a\u0430\u043a \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043e\u0434\u043d\u043e \u0447\u0438\u0441\u043b\u043e BigInt \u043a \u0441\u0442\u0435\u043f\u0435\u043d\u0438 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 BigInt. \u041d\u043e \u043a\u0430\u043a \u043d\u0430\u0441\u0447\u0451\u0442 \u0434\u0440\u043e\u0431\u043d\u043e\u0439 \u0441\u0442\u0435\u043f\u0435\u043d\u0438? \u041d\u0443, \u0435\u0441\u0442\u044c \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442:  <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/5f2\/bc4\/24b\/5f2bc424b6b37e0c72d5f22e59f59534.svg\" alt=\"$x^\\frac{1}{n} = \\sqrt[n]{x}$\" data-tex=\"display\"><\/math><\/p>\n<p>  \u0422\u043e \u0435\u0441\u0442\u044c \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u0435 xx \u043a \u0441\u0442\u0435\u043f\u0435\u043d\u0438 1n1n \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u043d\u043e \u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044e n-\u0433\u043e \u043a\u043e\u0440\u043d\u044f \u0438\u0437 xx. \u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u043c\u044b \u043d\u0430\u0439\u0434\u0435\u043c \u0441\u043f\u043e\u0441\u043e\u0431 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c n-\u0439 \u043a\u043e\u0440\u0435\u043d\u044c BigInt, \u0442\u043e \u043c\u044b \u0441\u043c\u043e\u0436\u0435\u043c \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u043b\u044e\u0431\u0443\u044e \u0441\u0442\u0435\u043f\u0435\u043d\u044c.<\/p>\n<p>  \u041f\u0440\u0438 \u0445\u043e\u0440\u043e\u0448\u043e \u043f\u0440\u043e\u0434\u0443\u043c\u0430\u043d\u043d\u043e\u043c \u043f\u043e\u0438\u0441\u043a\u0435 \u0432 \u0432\u0435\u0431\u0435, \u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u043e\u0446\u0435\u043d\u043a\u0438 n-\u0433\u043e \u043a\u043e\u0440\u043d\u044f \u043d\u0435 \u0437\u0430\u0439\u043c\u0451\u0442 \u043c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u041d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0451\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u2014 <a href=\"https:\/\/en.wikipedia.org\/wiki\/Newton&#39;s_method\">\u043c\u0435\u0442\u043e\u0434 \u041d\u044c\u044e\u0442\u043e\u043d\u0430<\/a>. \u041e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u043e\u0446\u0435\u043d\u043a\u0438, rr. \u0417\u0430\u0442\u0435\u043c \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u0442\u0430\u043a\u043e\u0439 \u0440\u0430\u0441\u0447\u0451\u0442, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043b\u0443\u0447\u0448\u0443\u044e \u043e\u0446\u0435\u043d\u043a\u0443:  <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8dd\/144\/8b9\/8dd1448b9fd28366273b4063ba3f25a0.svg\" alt=\"$\\begin{align} r &amp;\\approx x^{\\frac{1}{n}} \\\\ r^{\\prime} &amp;= \\frac{1}{n}\\left((n-1)r + \\left(\\frac{x}{r^{n-1}}\\right)\\right) \\end{align}$\" data-tex=\"display\"><\/math><\/p>\n<p>  \u041c\u044b \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0442\u044c \u044d\u0442\u0438 \u0440\u0430\u0441\u0447\u0451\u0442\u044b \u0434\u043e \u0442\u0435\u0445 \u043f\u043e\u0440, \u043f\u043e\u043a\u0430 \u043d\u0435 \u0434\u043e\u0441\u0442\u0438\u0433\u043d\u0435\u043c \u0436\u0435\u043b\u0430\u0435\u043c\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u0435\u0441\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043a\u043e\u0440\u043d\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0432 \u0432\u0438\u0434\u0435 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0434\u0440\u043e\u0431\u0438. \u0414\u0440\u0443\u0433\u0438\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u0443\u044e \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c, \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0434\u043b\u0438\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f BigInt. \u041d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u044d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0439.<\/p>\n<p>  \u041c\u044b \u0432\u0435\u0440\u043d\u0435\u043c\u0441\u044f \u043a \u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u043c\u0435\u043d\u0442\u0443. \u0410 \u043f\u043e\u043a\u0430 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c\u0441\u044f, \u043a\u0430\u043a \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0442\u043e\u0447\u043d\u044b\u0439 \u043a\u043e\u0440\u0435\u043d\u044c n-\u0439 \u0441\u0442\u0435\u043f\u0435\u043d\u0438. \u0422\u0430\u043a \u043a\u0430\u043a \u043e\u0446\u0435\u043d\u043a\u0430 rr \u0431\u0443\u0434\u0435\u0442 \u0434\u0440\u043e\u0431\u044c\u044e, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0435\u0451 \u043a\u0430\u043a:  <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/fd5\/669\/174\/fd56691747e8c95174780c326be7bfb7.svg\" alt=\"$r = \\frac{a}{b}.$\" data-tex=\"display\"><\/math><\/p>\n<p>  \u0418 \u044d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c \u0440\u0430\u0441\u0447\u0451\u0442\u044b \u0442\u0430\u043a:  <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9db\/c8e\/9a5\/9dbc8e9a54fdeb573d62b15ffd26f927.svg\" alt=\"$\\frac{a^{\\prime}}{b^{\\prime}} = \\frac{(n - 1)a^{n} + x b^{n}}{n b a^{n - 1}}$\" data-tex=\"display\"><\/math><\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0432\u0441\u0451 \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u0445 \u0446\u0435\u043b\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0445 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439, \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441 BigInt. \u041d\u0435 \u0441\u0442\u0435\u0441\u043d\u044f\u0439\u0442\u0435\u0441\u044c \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c abab \u0432 \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0434\u043b\u044f r\u2032r\u2032 \u0432\u044b\u0448\u0435 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u043c\u043e\u0438 \u0432\u044b\u0432\u043e\u0434\u044b. \u0412 JavaScript \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"javascript\">const estimate = [...new Array(NUM_ITERATIONS)].reduce(r =&gt; {   return simplify(     (n - BigInt(1)) * r.numerator ** n + x * r.denominator ** n,     n * r.denominator * r.numerator ** (n - BigInt(1))   ); }, INITIAL_ESTIMATE);<\/code><\/pre>\n<p>  \u041c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u043c \u044d\u0442\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u0434\u043e \u0442\u0435\u0445 \u043f\u043e\u0440, \u043f\u043e\u043a\u0430 \u043d\u0435 \u0434\u043e\u0441\u0442\u0438\u0433\u043d\u0435\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0435\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0439 \u043e\u0446\u0435\u043d\u043a\u0438 \u043a\u043e\u0440\u043d\u044f n-\u0439 \u0441\u0442\u0435\u043f\u0435\u043d\u0438. \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u0442\u044c \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043d\u0430\u0448\u0438\u0445 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442. \u0422\u043e \u0435\u0441\u0442\u044c NUM_ITERATIONS \u0438 INITIAL_ESTIMATE.<br \/>  \u041c\u043d\u043e\u0433\u0438\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442\u0441\u044f \u0441 INITIAL_ESTIMATE \u0432 \u0435\u0434\u0438\u043d\u0438\u0446\u0443. \u042d\u0442\u043e \u0440\u0430\u0437\u0443\u043c\u043d\u044b\u0439 \u0432\u044b\u0431\u043e\u0440. \u0417\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u0443 \u043d\u0430\u0441 \u043d\u0435\u0442 \u0445\u043e\u0440\u043e\u0448\u0435\u0433\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c, \u043a\u0430\u043a\u0438\u043c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043a\u043e\u0440\u0435\u043d\u044c n-\u0439 \u0441\u0442\u0435\u043f\u0435\u043d\u0438. \u041d\u043e \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u00ab\u043e\u0431\u043c\u0430\u043d\u043a\u0443\u00bb. \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c (\u043f\u043e\u043a\u0430), \u0447\u0442\u043e \u043d\u0430\u0448 \u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c \u0438 \u0437\u043d\u0430\u043c\u0435\u043d\u0430\u0442\u0435\u043b\u044c \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0435 Number. \u0417\u0430\u0442\u0435\u043c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Math.pow() \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0439 \u043e\u0446\u0435\u043d\u043a\u0438. \u042d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"javascript\">\/\/ Get an initial estimate using floating point math \/\/ Recall that x is a bigint value and n is the desired root. const initialEstimate = Ratio.fromNumber(     Math.pow(Number(x), 1 \/ Number(n)) );<\/code><\/pre>\n<p>  \u0418\u0442\u0430\u043a, \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0439 \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0439 \u043e\u0446\u0435\u043d\u043a\u0438. \u0410 \u043a\u0430\u043a \u0436\u0435 NUM_ITERATION? \u041d\u0443, \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435, \u0442\u043e, \u0447\u0442\u043e \u044f \u0434\u0435\u043b\u0430\u043b, \u043d\u0430\u0447\u0438\u043d\u0430\u043b\u043e\u0441\u044c \u0441 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 10. \u0410 \u043f\u043e\u0442\u043e\u043c \u044f \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u043b \u0442\u0435\u0441\u0442\u044b \u0441\u0432\u043e\u0439\u0441\u0442\u0432. \u042f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u043b \u043d\u0430\u0440\u0430\u0449\u0438\u0432\u0430\u0442\u044c \u0447\u0438\u0441\u043b\u043e \u0434\u043e \u0442\u0435\u0445 \u043f\u043e\u0440, \u043f\u043e\u043a\u0430 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0443\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u043b\u0438\u0441\u044c \u0432 \u0440\u0430\u0437\u0443\u043c\u043d\u044b\u0435 \u0441\u0440\u043e\u043a\u0438. \u0418 \u0446\u0438\u0444\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f, \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0430\u2026 1. \u041e\u0434\u043d\u0430 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u044f. \u042d\u0442\u043e \u043c\u0435\u043d\u044f \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043e\u0433\u043e\u0440\u0447\u0430\u0435\u0442, \u043d\u043e \u043c\u044b \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0431\u043e\u043b\u0435\u0435 \u0442\u043e\u0447\u043d\u044b, \u0447\u0435\u043c \u043f\u0440\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f\u0445 \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0442\u043e\u0447\u043a\u043e\u0439. \u041d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0442\u044c \u044d\u0442\u043e \u0447\u0438\u0441\u043b\u043e, \u0435\u0441\u043b\u0438 \u043d\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0435 \u043c\u043d\u043e\u0433\u043e \u0434\u0440\u043e\u0431\u043d\u044b\u0445 \u0441\u0442\u0435\u043f\u0435\u043d\u0435\u0439.<\/p>\n<p>  \u0414\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u043c\u044b \u0438\u0437\u0432\u043b\u0435\u0447\u0451\u043c \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 n-\u0433\u043e \u043a\u043e\u0440\u043d\u044f \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e. \u0415\u0441\u043b\u0438 \u0441\u043b\u043e\u0436\u0438\u0442\u044c \u0432\u0441\u0451 \u0432\u043c\u0435\u0441\u0442\u0435, \u043a\u043e\u0434 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"javascript\">\/\/ file: ratio.js -- inside the class declaration   static nthRoot(x, n) {     \/\/ Handle special cases     if (x === BigInt(1)) return new Ratio(BigInt(1), BigInt(1));     if (x === BigInt(0)) return new Ratio(BigInt(0), BigInt(1));     if (x &lt; 0) return new Ratio(BigInt(1), BigInt(0)); \/\/ Infinity      \/\/ Get an initial estimate using floating point math     const initialEstimate = Ratio.fromNumber(       Math.pow(Number(x), 1 \/ Number(n))     );      const NUM_ITERATIONS = 1;     return [...new Array(NUM_ITERATIONS)].reduce((r) =&gt; {       return simplify(         n -           BigInt(1) * (r.numerator ** n) +           x * (r.denominator ** n),         n * r.denominator * r.numerator ** (n - BigInt(1))       );     }, initialEstimate);   }    pow(n) {     const { numerator: nNumerator, denominator: nDenominator } = n.simplify();     const { numerator, denominator } = this.simplify();     if (nNumerator &lt; 0) return this.invert().pow(n.abs());     if (nNumerator === BigInt(0)) return Ratio.one;     if (nDenominator === BigInt(1)) {       return new Ratio(numerator ** nNumerator, denominator ** nNumerator);     }     if (numerator &lt; 0 &amp;&amp; nDenominator !== BigInt(1)) {       return Ratio.infinity;     }      const { numerator: newN, denominator: newD } = Ratio.nthRoot(       numerator,       nDenominator     ).divideBy(Ratio.nthRoot(denominator, nDenominator));     return new Ratio(newN ** nNumerator, newD ** nNumerator);   } <\/code><\/pre>\n<p>  \u041d\u0435\u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e \u0438 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e. \u041d\u043e \u0437\u0430\u0434\u0430\u0447\u0430 \u0441\u0442\u0430\u043b\u0430 \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c\u043e\u0439. \u041e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u0432\u043e\u043f\u0440\u043e\u0441, \u043a\u0430\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043e\u0446\u0435\u043d\u043a\u0443, \u0435\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u0446\u0435\u043b\u044b\u0435 \u0447\u0438\u0441\u043b\u0430 \u0431\u043e\u043b\u044c\u0448\u0435 Number.MAX_VALUE. \u041e\u0434\u043d\u0430\u043a\u043e \u044f \u043e\u0441\u0442\u0430\u0432\u043b\u044e \u044d\u0442\u043e \u043a\u0430\u043a \u0443\u043f\u0440\u0430\u0436\u043d\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044f; \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0438 \u0442\u0430\u043a \u0443\u0436\u0435 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0434\u043b\u0438\u043d\u043d\u0430\u044f. <\/p>\n<p>  <font color=\"#09b744\"><\/p>\n<h2>\u041b\u043e\u0433\u0430\u0440\u0438\u0444\u043c\u044b<\/h2>\n<p><\/font><br \/>  \u0414\u043e\u043b\u0436\u0435\u043d \u043f\u0440\u0438\u0437\u043d\u0430\u0442\u044c, \u043b\u043e\u0433\u0430\u0440\u0438\u0444\u043c\u044b \u043e\u0437\u0430\u0434\u0430\u0447\u0438\u043b\u0438 \u043c\u0435\u043d\u044f \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u0435\u0434\u0435\u043b\u044c. \u0414\u043b\u044f \u043c\u043e\u0435\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u043b\u043e\u0433\u0430\u0440\u0438\u0444\u043c\u044b \u043f\u043e \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u044e 10. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u043f\u043e\u0448\u0451\u043b \u0438\u0441\u043a\u0430\u0442\u044c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0434\u043b\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u043b\u043e\u0433\u0430\u0440\u0438\u0444\u043c\u043e\u0432. \u0418 \u0438\u0445 \u043c\u043d\u043e\u0433\u043e. \u041d\u043e \u044f \u043d\u0435 \u0441\u043c\u043e\u0433 \u043d\u0430\u0439\u0442\u0438 \u0442\u0430\u043a\u043e\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0431\u044b \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0445\u043e\u0440\u043e\u0448\u043e, \u0447\u0442\u043e\u0431\u044b \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0435\u0433\u043e \u0432 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443.<\/p>\n<p>  \u041f\u043e\u0447\u0435\u043c\u0443 \u044d\u0442\u043e \u0442\u0430\u043a \u0441\u043b\u043e\u0436\u043d\u043e? \u041c\u043e\u0435\u0439 \u0446\u0435\u043b\u044c\u044e \u0431\u044b\u043b\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u043b\u043e\u0433\u0430\u0440\u0438\u0444\u043c\u044b \u0440\u0430\u0434\u0438 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0431\u043e\u043b\u044c\u0448\u0435\u0439, \u0447\u0435\u043c \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u0447\u0438\u0441\u0435\u043b \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0442\u043e\u0447\u043a\u043e\u0439. \u0418\u043d\u0430\u0447\u0435 \u0437\u0430\u0447\u0435\u043c \u0432\u0441\u0451 \u044d\u0442\u043e? \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u043b\u043e\u0433\u0430\u0440\u0438\u0444\u043c\u0430 \u0441 \u0442\u0438\u043f\u043e\u043c \u0447\u0438\u0441\u043b\u0430 \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0442\u043e\u0447\u043a\u043e\u0439, Math.log10(), \u0431\u044b\u0441\u0442\u0440\u0430\u044f \u0438 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u0430\u044f. \u0418\u0442\u0430\u043a, \u044f \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u043b \u043d\u0430 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0430\u044e\u0442 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0438\u0442\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u043b\u043e\u0433\u0430\u0440\u0438\u0444\u043c\u043e\u0432. \u0418 \u043e\u043d\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442. \u041d\u043e \u043e\u043d\u0438 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b \u0432 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0438 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0432\u044b\u0448\u0435 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0447\u0438\u0441\u043b\u0430 \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0442\u043e\u0447\u043a\u043e\u0439. \u041d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435. \u041d\u0430\u043c\u043d\u043e\u0433\u043e \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435.<\/p>\n<p>  \u041f\u043e \u043c\u0435\u0440\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u043c\u044b \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043c \u0447\u0435\u0440\u0435\u0437 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438, \u0434\u0440\u043e\u0431\u044c, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u044b \u0441\u0442\u0440\u043e\u0438\u043c, \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0432\u0441\u0451 \u0442\u043e\u0447\u043d\u0435\u0435. \u041d\u043e \u0437\u0430 \u044d\u0442\u0443 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u043b\u0430\u0442\u0438\u0442\u044c. \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u044f BigInt \u0432 \u0434\u0440\u043e\u0431\u0438 \u0441\u0442\u0430\u043d\u043e\u0432\u044f\u0442\u0441\u044f \u0432\u0441\u0451 \u0431\u043e\u043b\u044c\u0448\u0435 \u0438 \u0431\u043e\u043b\u044c\u0448\u0435. \u0418 \u043f\u043e \u043c\u0435\u0440\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u043e\u043d\u0438 \u0441\u0442\u0430\u043d\u043e\u0432\u044f\u0442\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u0435, \u0438\u0445 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u0412 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043c\u043e\u043c\u0435\u043d\u0442 \u044f \u043e\u0441\u0442\u0430\u0432\u0438\u043b \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u043d\u0430 \u0442\u0440\u0438 \u0434\u043d\u044f. \u041d\u043e \u043f\u043e\u043a\u0430 \u0448\u043b\u0438 \u0440\u0430\u0441\u0447\u0451\u0442\u044b, \u044f \u043a\u043e\u0435-\u0447\u0442\u043e \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u043b.<\/p>\n<p>  \u042f \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u043b, \u0447\u0442\u043e \u043c\u043d\u0435 \u043d\u0443\u0436\u0435\u043d \u043c\u0435\u0442\u043e\u0434 log10() \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0442\u044c \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0435 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432. \u0418 \u0434\u043b\u044f \u044d\u0442\u0438\u0445 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u044f \u0432\u044b\u0437\u044b\u0432\u0430\u043b .log10(), \u044f \u0441\u0440\u0430\u0437\u0443 \u0436\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u043b .floor(). \u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0446\u0435\u043b\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043b\u043e\u0433\u0430\u0440\u0438\u0444\u043c\u0430. \u0420\u0430\u0441\u0447\u0451\u0442 \u043b\u043e\u0433\u0430\u0440\u0438\u0444\u043c\u0430 \u0434\u043e 100 \u0437\u043d\u0430\u043a\u043e\u0432 \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u044f\u0442\u043e\u0439 \u0431\u044b\u043b \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0443\u0441\u0442\u043e\u0439 \u0442\u0440\u0430\u0442\u043e\u0439 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438 \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u0435\u0439.<\/p>\n<p>  \u0411\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e, \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u0446\u0435\u043b\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u043b\u043e\u0433\u0430\u0440\u0438\u0444\u043c\u0430 \u043f\u043e \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u044e 10. \u0412\u0441\u0451, \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e, \u2014 \u044d\u0442\u043e \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0446\u0438\u0444\u0440\u044b. \u041d\u0430\u0438\u0432\u043d\u0430\u044f \u043f\u043e\u043f\u044b\u0442\u043a\u0430 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"javascript\">\/\/ file: ratio.js -- inside the class declaration   floorLog10() {     return simplify(BigInt((this.numerator \/ this.denominator).toString().length - 1), BigInt(1));   }<\/code><\/pre>\n<p>  \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u044d\u0442\u043e \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0434\u043b\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043c\u0435\u043d\u044c\u0448\u0435 1. \u041d\u043e \u0434\u0430\u0436\u0435 \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043b\u043e\u0433\u0430\u0440\u0438\u0444\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0437\u0430\u043a\u043e\u043d\u044b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0442\u0430\u043a\u0438\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c.  <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/fd7\/1d5\/e30\/fd71d5e300519220acf22381449d2786.svg\" alt=\"$\\begin{align} \\log_{10}\\left(\\frac{a}{b}\\right) &amp;= \\log_{10}(a) - \\log_{10}(b) \\\\ \\log_{10}\\left(\\frac{1}{x}\\right) &amp;= \\log_{10}(1) - \\log_{10}(x) \\\\ &amp;= -\\log_{10}(x) \\end{align}$\" data-tex=\"display\"><\/math><\/p>\n<p>  \u041f\u043e\u044d\u0442\u043e\u043c\u0443:  <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/03c\/787\/406\/03c787406e8ab18b1d8df569e3a110a0.svg\" alt=\"$\\log_{10}\\left(\\frac{b}{a}\\right) = -\\log_{10}\\left(\\frac{a}{b}\\right)$\" data-tex=\"display\"><\/math><\/p>\n<p>  \u0421\u043e\u0431\u0440\u0430\u0432 \u0432\u0441\u0451 \u0432\u043e\u0435\u0434\u0438\u043d\u043e, \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0431\u043e\u043b\u0435\u0435 \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 floorLog10():<\/p>\n<pre><code class=\"javascript\">\/\/ file: ratio.js -- inside the class declaration    invert() {     return simplify(this.denominator, this.numerator);   }    floorLog10() {     if (this.equals(simplify(BigInt(0), BigInt(1)))) {       return new Ratio(BigInt(-1), BigInt(0));     }     return this.numerator &gt;= this.denominator       ? simplify((this.numerator \/ this.denominator).toString().length - 1, 1)       : simplify(BigInt(-1), BigInt(1)).subtract(this.invert().floorLog10());   }<\/code><\/pre>\n<p>  <font color=\"#09b744\"><\/p>\n<h2>\u041e\u043f\u044f\u0442\u044c. \u0417\u0430\u0447\u0435\u043c \u043c\u0443\u0447\u0438\u0442\u044c\u0441\u044f?<\/h2>\n<p><\/font><br \/>  \u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0438\u043c\u0435\u0435\u0442 \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u043c\u043e\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0433\u0440\u0430\u0444\u0438\u043a\u0430\u043c\u0438. \u041d\u043e \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0437\u0430\u0447\u0435\u043c \u0432\u0441\u0435 \u044d\u0442\u0438 \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u043e\u0441\u0442\u0438? \u0423\u0436\u0435 \u0435\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438. \u041f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0434\u043d\u0443 \u0438\u0437 \u043d\u0438\u0445 \u0438 \u043d\u0435 \u043f\u043e\u043a\u043e\u043d\u0447\u0438\u0442\u044c \u0441 \u044d\u0442\u0438\u043c?<\/p>\n<p>  \u0427\u0435\u0441\u0442\u043d\u043e \u0433\u043e\u0432\u043e\u0440\u044f, \u044f \u0431\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e, \u0435\u0441\u043b\u0438 \u044f \u0442\u043e\u0440\u043e\u043f\u043b\u044e\u0441\u044c. \u041d\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430 \u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0441\u0451 \u044d\u0442\u043e, \u0435\u0441\u043b\u0438 \u043a\u0442\u043e-\u0442\u043e \u0443\u0436\u0435 \u0441\u0434\u0435\u043b\u0430\u043b \u043f\u0440\u0435\u0432\u043e\u0441\u0445\u043e\u0434\u044f\u0449\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443.<\/p>\n<p>  \u041a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e \u0437\u0434\u0435\u0441\u044c \u2014 \u00ab\u043f\u0440\u0435\u0432\u043e\u0441\u0445\u043e\u0434\u044f\u0449\u0443\u044e\u00bb. \u0418 \u0438\u043c\u0435\u043d\u043d\u043e \u0437\u0434\u0435\u0441\u044c \u0432 \u0438\u0433\u0440\u0443 \u0432\u0441\u0442\u0443\u043f\u0430\u044e\u0442 \u043c\u043e\u0438 \u043c\u043e\u0442\u0438\u0432\u044b \u0436\u0435\u043b\u0430\u043d\u0438\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u044e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443. \u041c\u0435\u0442\u043e\u0434 floorLog10() \u0432\u044b\u0448\u0435 \u2014 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440. \u041e\u043d \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0442\u043e\u0447\u043d\u044b\u0439 \u0440\u0430\u0441\u0447\u0451\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043d\u0435 \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0445\u043e\u0447\u0443 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044f. \u041e\u043d \u0434\u0435\u043b\u0430\u0435\u0442 \u044d\u0442\u043e \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e, \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0432 \u0448\u0435\u0441\u0442\u0438 \u0441\u0442\u0440\u043e\u043a\u0430\u0445 \u043a\u043e\u0434\u0430.<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0431\u044b \u044f \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u0447\u0443\u0436\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439, \u044f \u0431\u044b \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u0434\u0432\u0443\u0445:<\/p>\n<ol>\n<li>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043d\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b\u0438 log10() \u0438\u043b\u0438 \u043b\u044e\u0431\u044b\u0435 \u0434\u0440\u0443\u0433\u0438\u0435 \u043b\u043e\u0433\u0430\u0440\u0438\u0444\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b.<\/li>\n<\/ol>\n<p>  \u0438\u043b\u0438<\/p>\n<ol>\n<li>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 <i>\u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b\u0438<\/i> \u043c\u0435\u0442\u043e\u0434 log10() (\u0438\u043b\u0438 \u0435\u0433\u043e \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442).<\/li>\n<\/ol>\n<p>  \u0412 \u043f\u0435\u0440\u0432\u043e\u043c \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u043c\u043d\u0435 \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0431\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c floorLog10(). \u0412\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u044f \u0431\u044b, \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0438\u0445 \u043b\u043e\u0433\u0430\u0440\u0438\u0444\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043c\u0435\u0442\u043e\u0434. \u0418 \u043c\u043e\u0439 \u043a\u043e\u0434 \u0431\u044b\u043b \u0431\u044b \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435 \u0438 \u0441\u043b\u043e\u0436\u043d\u0435\u0435, \u0447\u0435\u043c \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c.<\/p>\n<p>  \u041d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043c\u043d\u0435 \u0430\u0434\u0430\u043f\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0451 \u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e. \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0434\u0440\u0443\u0433\u0438\u0435 \u043b\u044e\u0434\u0438 \u043c\u043e\u0433\u0443\u0442 \u043d\u0430\u0439\u0442\u0438 \u043a\u043e\u0434 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c, \u043d\u043e \u044f \u043d\u0435 \u0432 \u043e\u0442\u0432\u0435\u0442\u0435 \u0437\u0430 \u0438\u0445 \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u0438. \u0427\u0442\u043e\u0431\u044b \u043c\u043e\u0435\u043c\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e \u043d\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u0442\u0430\u0441\u043a\u0430\u0442\u044c \u0437\u0430 \u0441\u043e\u0431\u043e\u0439 \u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u043d\u043e \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442.<\/p>\n<p>  \u041a\u0440\u043e\u043c\u0435 \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e\u0433\u043e, \u044f \u043c\u043d\u043e\u0433\u043e\u043c\u0443 \u043d\u0430\u0443\u0447\u0438\u043b\u0441\u044f, \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u044f \u0441\u0432\u043e\u044e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443. \u0422\u0435\u043f\u0435\u0440\u044c \u044f \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u044e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f BigInt \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u043b\u0443\u0447\u0448\u0435, \u0447\u0435\u043c \u0440\u0430\u043d\u044c\u0448\u0435. \u042f \u0437\u043d\u0430\u044e, \u0447\u0442\u043e \u043c\u043e\u0433\u0443 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u0430 \u043a\u043e\u0440\u043d\u044f n-\u0439 \u0441\u0442\u0435\u043f\u0435\u043d\u0438. \u042f \u043c\u043e\u0433\u0443 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0435\u0433\u043e \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u043e\u0433\u043e, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e \u0438 \u043a\u0430\u043a\u0430\u044f \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u0430.<\/p>\n<p>  \u0418\u043d\u043e\u0433\u0434\u0430 \u0441\u0442\u043e\u0438\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u044e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u043e\u0431\u0449\u0435\u0433\u043e \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u0414\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0442\u044b \u043d\u0435 \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u0448\u044c \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0442\u044c \u043a\u043e\u0434. \u0414\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u043d\u0438\u043a\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u0435\u044e \u043d\u0435 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f. \u0422\u044b \u043c\u043e\u0436\u0435\u0448\u044c \u043c\u043d\u043e\u0433\u043e\u043c\u0443 \u043d\u0430\u0443\u0447\u0438\u0442\u044c\u0441\u044f, \u0438, \u043a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u043d\u0435\u0441\u0442\u0438 \u0440\u0430\u0434\u043e\u0441\u0442\u044c.<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0437\u043d\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u0445 \u0441 \u0447\u0438\u0441\u043b\u0430\u043c\u0438 \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0442\u043e\u0447\u043a\u043e\u0439, \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435\u0441\u044c \u043a <a href=\"https:\/\/0.30000000000000004.com\/\">0.30000000000000004.com<\/a>. \u0410 \u0435\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0446\u0435\u043b\u0438\u043a\u043e\u043c \u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f, \u0442\u043e \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c <a href=\"https:\/\/codesandbox.io\/s\/ratio-high-precision-math-hwnry?file=\/src\/ratio.js\">\u044d\u0442\u0443 \u043f\u0435\u0441\u043e\u0447\u043d\u0438\u0446\u0443 \u0441 \u043a\u043e\u0434\u043e\u043c<\/a>.<\/p>\n<p>  <a href=\"https:\/\/skillfactory.ru\/?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_banner&amp;utm_term=regular&amp;utm_content=habr_banner\"><\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/yi\/z1\/ur\/yiz1urm30u2xkpduowuc0askhr4.png\" alt=\"image\"><\/div>\n<p><\/a><\/p>\n<ul>\n<li><a href=\"https:\/\/skillfactory.ru\/javascript?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_FJS&amp;utm_term=regular&amp;utm_content=261220\">\u041a\u0443\u0440\u0441 \u043f\u043e JavaScript<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/dstpro?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_DSPR&amp;utm_term=regular&amp;utm_content=261220\">\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u0438 Data Science<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/dataanalystpro?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_DAPR&amp;utm_term=regular&amp;utm_content=261220\">\u041e\u0431\u0443\u0447\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u0438 Data Analyst<\/a><\/li>\n<\/ul>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0414\u0440\u0443\u0433\u0438\u0435 \u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u0438 \u0438 \u043a\u0443\u0440\u0441\u044b<\/b>                         <\/p>\n<div class=\"spoiler_text\"><strong>\u041f\u0420\u041e\u0424\u0415\u0421\u0421\u0418\u0418<\/strong><\/p>\n<ul>\n<li><a href=\"https:\/\/skillfactory.ru\/java?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_JAVA&amp;utm_term=regular&amp;utm_content=261220\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Java-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/frontend?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_FR&amp;utm_term=regular&amp;utm_content=261220\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Frontend-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/cybersecurity?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_HACKER&amp;utm_term=regular&amp;utm_content=261220\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f \u042d\u0442\u0438\u0447\u043d\u044b\u0439 \u0445\u0430\u043a\u0435\u0440<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/cplus?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_CPLUS&amp;utm_term=regular&amp;utm_content=261220\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f C++ \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/game-dev?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_GAMEDEV&amp;utm_term=regular&amp;utm_content=261220\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0438\u0433\u0440 \u043d\u0430 Unity<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/iosdev?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_IOSDEV&amp;utm_term=regular&amp;utm_content=261220\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f iOS-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0441 \u043d\u0443\u043b\u044f<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/android?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_ANDR&amp;utm_term=regular&amp;utm_content=261220\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f Android-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0441 \u043d\u0443\u043b\u044f<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/webdev?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_WEBDEV&amp;utm_term=regular&amp;utm_content=261220\">\u041f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u044f \u0412\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a<\/a><\/li>\n<\/ul>\n<p>  <\/p>\n<hr>\n<p>  <strong>\u041a\u0423\u0420\u0421\u042b<\/strong><\/p>\n<ul>\n<li><a href=\"https:\/\/skillfactory.ru\/ml-programma-machine-learning-online?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_ML&amp;utm_term=regular&amp;utm_content=261220\">\u041a\u0443\u0440\u0441 \u043f\u043e Machine Learning<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/ml-and-dl?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_MLDL&amp;utm_term=regular&amp;utm_content=261220\">\u041f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u0439 \u043a\u0443\u0440\u0441 \u00abMachine Learning Pro + Deep Learning\u00bb<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/python-for-web-developers?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_PWS&amp;utm_term=regular&amp;utm_content=261220\">\u041a\u0443\u0440\u0441 \u00abPython \u0434\u043b\u044f \u0432\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438\u00bb<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/math_and_ml?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_MATML&amp;utm_term=regular&amp;utm_content=261220\">\u041a\u0443\u0440\u0441 \u00ab\u041c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0430 \u0438 Machine Learning \u0434\u043b\u044f Data Science\u00bb<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/analytics?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_SDA&amp;utm_term=regular&amp;utm_content=261220\">\u041a\u0443\u0440\u0441 \u043f\u043e \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0435 \u0434\u0430\u043d\u043d\u044b\u0445<\/a><\/li>\n<li><a href=\"https:\/\/skillfactory.ru\/devops?utm_source=infopartners&amp;utm_medium=habr&amp;utm_campaign=habr_DEVOPS&amp;utm_term=regular&amp;utm_content=261220\">\u041a\u0443\u0440\u0441 \u043f\u043e DevOps<\/a><\/li>\n<\/ul>\n<p>  <\/div>\n<\/p><\/div>\n<\/div>\n<p> \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\/company\/skillfactory\/blog\/535138\/\"> https:\/\/habr.com\/ru\/company\/skillfactory\/blog\/535138\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">\u0412 JavaScript \u0435\u0441\u0442\u044c \u043d\u0435\u043c\u0430\u043b\u043e \u043c\u043e\u043c\u0435\u043d\u0442\u043e\u0432, \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u0445 \u0432\u043e\u043f\u0440\u043e\u0441 \u00ab\u0427\u0435\u0433\u043e???\u00bb. \u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e \u0447\u0442\u043e \u0443 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0430 \u0438\u0437 \u043d\u0438\u0445 \u0435\u0441\u0442\u044c \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u0435, \u0435\u0441\u043b\u0438 \u0432\u044b \u0432\u043d\u0438\u043a\u043d\u0435\u0442\u0435, \u043e\u043d\u0438 \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u043c\u043e\u0433\u0443\u0442 \u0443\u0434\u0438\u0432\u043b\u044f\u0442\u044c. \u041d\u043e JavaScript \u0442\u043e\u0447\u043d\u043e \u043d\u0435 \u0437\u0430\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u0435\u0442 \u0432\u043e\u0437\u043c\u0443\u0442\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0448\u0443\u0442\u043e\u043a \u0442\u0438\u043f\u0430 \u044d\u0442\u043e\u0439 \u0441\u043c\u0435\u0445\u0430. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0438\u043d\u043e\u0433\u0434\u0430 \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u0442\u0430\u043a\u0438\u0435 \u0448\u0443\u0442\u043a\u0438:<\/p>\n<p>  <a href=\"https:\/\/habr.com\/ru\/company\/skillfactory\/blog\/535138\/\"><\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/bu\/zy\/gp\/buzygp2yrzz9bfh4y_4dl6w77-i.jpeg\"><\/div>\n<p><\/a><br \/>  \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u0440\u0438\u0442\u0438\u043a\u0430 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u043d\u0435 \u0437\u0430\u0441\u043b\u0443\u0436\u0435\u043d\u0430. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u0447\u0435\u043c\u0443.  <\/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-315582","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/315582","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=315582"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/315582\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=315582"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=315582"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=315582"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}