{"id":313866,"date":"2020-11-26T21:02:25","date_gmt":"2020-11-26T21:02:25","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=313866"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=313866","title":{"rendered":"NaN \u0432\u0441\u0435 \u0435\u0449\u0435 \u043c\u043e\u0436\u0435\u0442 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0443\u0434\u0438\u0432\u0438\u0442\u044c"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/dy\/zw\/00\/dyzw005iudrhrajc0xv4fe7857e.png\" alt=\"image\"><\/p>\n<p>  \u0421\u043d\u0430\u0447\u0430\u043b\u0430, \u044f \u043f\u043e\u0434\u0443\u043c\u0430\u043b, \u0447\u0442\u043e \u044d\u0442\u043e \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 \u0432\u043e\u043f\u0440\u043e\u0441 \u0438\u0437 \u0442\u0435\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0438. \u041d\u0430\u0432\u0435\u0440\u043d\u043e\u0435, \u0435\u0441\u043b\u0438 \u043a\u0430\u043a \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043f\u043e\u0440\u0430\u0441\u043a\u0438\u043d\u0443\u0442\u044c \u043c\u043e\u0437\u0433\u0430\u043c\u0438, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0433\u0430\u0434\u0430\u0442\u044c\u0441\u044f \u0434\u043e \u0442\u043e\u0433\u043e, \u043a\u0430\u043a\u0438\u043c \u0431\u0443\u0434\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442. \u041e\u0442\u043a\u0438\u043d\u0443\u0432\u0448\u0438\u0441\u044c \u043d\u0430 \u0441\u043f\u0438\u043d\u043a\u0443 \u043a\u0440\u0435\u0441\u043b\u0430, \u043d\u0430\u0447\u0430\u043b \u0440\u0430\u0437\u043c\u044b\u0448\u043b\u044f\u0442\u044c, \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443, \u0432\u0441\u043f\u043e\u043c\u0438\u043d\u0430\u0442\u044c \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c, \u043d\u0430 \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0435\u0440\u0435\u0442\u044c\u0441\u044f \u0432 \u0440\u0430\u0441\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u044f\u0445. \u041d\u043e \u0442\u0449\u0435\u0442\u043d\u043e! \u0412\u0434\u0440\u0443\u0433 \u0441\u0442\u0430\u043b\u043e \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u043d\u0430\u0439\u0442\u0438 \u043e\u0442\u0432\u0435\u0442 \u043d\u0435 \u0443\u0434\u0430\u0435\u0442\u0441\u044f. \u041d\u043e \u043f\u043e\u0447\u0435\u043c\u0443? \u0412 \u0447\u0435\u043c \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u0431\u044b\u043b \u043d\u0430\u0439\u0434\u0435\u043d? \u0412 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0435? \u0412 \u044f\u0437\u044b\u043a\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f?<br \/>  <a name=\"habracut\"><\/a><br \/>  \u041e\u0442\u0432\u0435\u0442 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c NaN. \u041d\u043e \u043f\u043e\u0447\u0435\u043c\u0443 \u044f \u043d\u0435 \u0443\u0432\u0435\u0440\u0435\u043d \u0432 \u044d\u0442\u043e\u043c? \u0412\u0441\u044e \u0434\u043e\u0440\u043e\u0433\u0443 \u0431\u044b\u043b\u0430 \u0443\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043b\u044e\u0431\u044b\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0435 NaN, \u0432\u0435\u0440\u043d\u0443\u0442 NaN. \u041d\u0443 \u0440\u0430\u0437\u0432\u0435 \u0447\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0435\u0441\u043b\u0438 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c NaN \u043d\u0430 \u043d\u043e\u043b\u044c \u2014 \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u043d\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 <i>ZeroDivisionError<\/i>. \u0421\u0442\u043e \u043f\u0440\u043e\u0446\u0435\u043d\u0442\u043e\u0432 NaN! <\/p>\n<p>  \u0412\u0432\u043e\u0436\u0443 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0432 \u044f\u0447\u0435\u0439\u043a\u0443 \u0431\u043b\u043e\u043a\u043d\u043e\u0442\u0430:<\/p>\n<pre><code class=\"python\">&gt;&gt;&gt; 1**nan + 1**nan 2.0<\/code><\/pre>\n<p>  \u0412 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435? \u041f\u043e\u0441\u0442\u043e\u0439\u0442\u0435:<\/p>\n<pre><code class=\"python\">&gt;&gt;&gt; arange(5)**nan array([nan,  1., nan, nan, nan])<\/code><\/pre>\n<p>  \u0422\u043e \u0435\u0441\u0442\u044c, \u043f\u043e \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0435, \u0435\u0434\u0438\u043d\u0438\u0446\u0430 \u0432 \u0441\u0442\u0435\u043f\u0435\u043d\u0438 NaN \u2014 \u044d\u0442\u043e \u0435\u0434\u0438\u043d\u0438\u0446\u0430, \u0430 \u0432\u043e\u0442 \u043d\u043e\u043b\u044c \u0438 \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0447\u0438\u0441\u043b\u0430 \u0432 \u0441\u0442\u0435\u043f\u0435\u043d\u0438 NaN \u2014 \u044d\u0442\u043e NaN. \u0413\u0434\u0435 \u043b\u043e\u0433\u0438\u043a\u0430? \u0412 \u0447\u0435\u043c \u0434\u0435\u043b\u043e?<\/p>\n<p>  \u0422\u0430\u043a, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0435\u0449\u0435 \u0440\u0430\u0437:<\/p>\n<pre><code class=\"python\">&gt;&gt;&gt; 0**nan, 1**nan (nan, 1.0)<\/code><\/pre>\n<p>  \u041c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u044f \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0437-\u0437\u0430 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u044f \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043d\u0430\u0434\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u0432 \u0433\u043b\u0443\u0431\u043e\u043a\u0438\u0445 \u043f\u043e\u0437\u043d\u0430\u043d\u0438\u044f\u0445 \u043e NaN, \u043f\u0440\u043e\u0441\u0442\u043e \u043e \u0447\u0435\u043c-\u0442\u043e \u043d\u0435 \u043f\u043e\u0434\u043e\u0437\u0440\u0435\u0432\u0430\u043b? \u0410 \u043c\u043e\u0436\u0435\u0442 \u044f \u0437\u043d\u0430\u043b, \u043d\u043e \u0437\u0430\u0431\u044b\u043b? \u0410 \u043c\u043e\u0436\u0435\u0442 \u0435\u0449\u0435 \u0445\u0443\u0436\u0435 \u2014 \u044f \u043d\u0435 \u0437\u043d\u0430\u043b \u0438 \u0437\u0430\u0431\u044b\u043b?<\/p>\n<p>  \u0417\u0430\u0445\u043e\u0434\u0438\u043c \u043d\u0430 <a href=\"https:\/\/en.wikipedia.org\/wiki\/NaN\" rel=\"nofollow\">\u0412\u0438\u043a\u0438\u043f\u0435\u0434\u0438\u044e<\/a>. \u0422\u0430\u043c \u0434\u0430\u043d\u043d\u044b\u0439 \u0432\u043e\u043f\u0440\u043e\u0441 \u0442\u043e\u0436\u0435 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0435\u043d \u043a\u0430\u043a \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430, \u043d\u043e \u043f\u043e\u0447\u0435\u043c\u0443 \u0432\u0441\u0435 \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a \u0443\u0441\u0442\u0440\u043e\u0435\u043d\u043e, \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u043e\u0431\u044a\u044f\u0441\u043d\u044f\u0435\u0442\u0441\u044f. \u0417\u0430\u0442\u043e \u0443\u0437\u043d\u0430\u043b \u0447\u0442\u043e:<\/p>\n<pre><code class=\"python\">&gt;&gt;&gt; hypot(inf, nan) inf<\/code><\/pre>\n<p>  \u0425\u043e\u0442\u044f, \u0432 \u0442\u043e \u0436\u0435 \u0432\u0440\u0435\u043c\u044f:<\/p>\n<pre><code class=\"python\">&gt;&gt;&gt; sqrt(inf**2 + nan**2) nan<\/code><\/pre>\n<p>  \u0427\u0442\u043e, \u0441\u043e\u0433\u043b\u0430\u0441\u0438\u0442\u0435\u0441\u044c, \u0442\u043e\u0436\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u0442\u0440\u0430\u043d\u043d\u043e.<\/p>\n<p>  \u041b\u0430\u0434\u043d\u043e, \u0441 \u0412\u0438\u043a\u0438\u043f\u0435\u0434\u0438\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u0441\u044f \u0432 <a href=\"http:\/\/www.open-std.org\/jtc1\/sc22\/wg14\/www\/C99RationaleV5.10.pdf\" rel=\"nofollow\">C99<\/a> \u043d\u0430 182 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0438 \u043d\u0430\u043a\u043e\u043d\u0435\u0446-\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u0435, \u043f\u043e\u0447\u0435\u043c\u0443 <b>pow(x, 0)<\/b> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 1 \u0434\u043b\u044f \u043b\u044e\u0431\u044b\u0445 <b>x<\/b>, \u0434\u0430\u0436\u0435 \u0434\u043b\u044f <b>x<\/b> \u0440\u0430\u0432\u043d\u043e\u0433\u043e NaN:<\/p>\n<pre><code class=\"python\">&gt;&gt;&gt; power(nan, 0) 1.0<\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d93\/13f\/8d0\/d9313f8d06735d6988074f717265c2ac.svg\" alt=\"$f(x)$\" data-tex=\"inline\"><\/math> \u0432\u043e\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0441\u0442\u0435\u043f\u0435\u043d\u044c <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/41d\/1c2\/65e\/41d1c265e788bb39c5f094f4c3acf330.svg\" alt=\"$g(x)$\" data-tex=\"inline\"><\/math> \u0438 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/41d\/1c2\/65e\/41d1c265e788bb39c5f094f4c3acf330.svg\" alt=\"$g(x)$\" data-tex=\"inline\"><\/math> \u0441\u0442\u0440\u0435\u043c\u0438\u0442\u0441\u044f \u043a 0, \u0442\u043e \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f 1, \u0432\u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u043c\u0435\u0435\u0442 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d93\/13f\/8d0\/d9313f8d06735d6988074f717265c2ac.svg\" alt=\"$f(x)$\" data-tex=\"inline\"><\/math>.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/t5\/hb\/kv\/t5hbkvjk8_h_frpewnuyrqudhwy.png\" alt=\"image\"><\/p>\n<p>  \u0410 \u0435\u0441\u043b\u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0447\u0438\u0441\u043b\u043e\u0432\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d93\/13f\/8d0\/d9313f8d06735d6988074f717265c2ac.svg\" alt=\"$f(x)$\" data-tex=\"inline\"><\/math>, \u0442\u043e 1 \u2014 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c, \u0434\u0430\u0436\u0435 \u0434\u043b\u044f NaN. \u041e\u0434\u043d\u0430\u043a\u043e \u044d\u0442\u043e \u043f\u043e-\u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u043d\u0435 \u043e\u0431\u044a\u044f\u0441\u043d\u044f\u0435\u0442, \u043f\u043e\u0447\u0435\u043c\u0443 1 \u0432 \u0441\u0442\u0435\u043f\u0435\u043d\u0438 NaN \u0440\u0430\u0432\u043d\u0430 1.<\/p>\n<p>  \u041e\u0442\u044b\u0441\u043a\u0438\u0432\u0430\u0435\u043c \u0435\u0449\u0435 \u043e\u0434\u0438\u043d <a href=\"http:\/\/www.open-std.org\/jtc1\/sc22\/wg14\/www\/docs\/n1256.pdf\" rel=\"nofollow\">C99<\/a> \u0438 \u043d\u0430 461 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043d\u0435 \u0432\u0438\u0434\u0438\u043c \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u0439, \u043f\u0440\u043e\u0441\u0442\u043e \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e <b>pow(+1, y)<\/b> \u0434\u043e\u043b\u0436\u043d\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c 1 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 <b>y<\/b>, \u0434\u0430\u0436\u0435 \u0440\u0430\u0432\u043d\u044b\u0445 NaN. \u0412\u0441\u0435.<\/p>\n<p>  \u0421 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u0435, \u043f\u043e\u0447\u0435\u043c\u0443 <b>pow(NaN, 0)=1<\/b> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c, \u0447\u0435\u043c <b>pow(NaN, 0)=NaN<\/b> \u0432\u0441\u0435-\u0442\u0430\u043a\u0438 \u043d\u0430\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0435\u0442 \u043d\u0430 \u043c\u044b\u0441\u043b\u044c \u043e \u0442\u043e\u043c, \u0447\u0442\u043e NaN \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u0432\u043e\u0441\u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0431\u0443\u043a\u0432\u0430\u043b\u044c\u043d\u043e, \u043a\u0430\u043a <i>Not-a-Number<\/i>. \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043a\u0430\u043a\u0438\u0445- \u0442\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0447\u0438\u0441\u043b\u043e, \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u044e\u0449\u0435\u0435 \u0440\u0430\u0437\u043c\u0435\u0440 \u043f\u0430\u043c\u044f\u0442\u0438, \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u043f\u043e\u0434 \u0434\u0430\u043d\u043d\u044b\u0439 \u0442\u0438\u043f \u0447\u0438\u0441\u0435\u043b, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"python\">&gt;&gt;&gt; a = pi*10e307 &gt;&gt;&gt; a inf<\/code><\/pre>\n<p>  \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 <i>inf<\/i>, \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u043e \u0437\u0430 \u0447\u0438\u0441\u043b\u043e \u043c\u044b \u043d\u0435 \u0437\u043d\u0430\u0435\u043c, \u043d\u043e \u0432\u0441\u0435 \u0436\u0435 \u044d\u0442\u043e \u043a\u0430\u043a\u043e\u0435-\u0442\u043e \u0447\u0438\u0441\u043b\u043e. \u0417\u0430\u0442\u0435\u043c \u043c\u044b \u0441\u043d\u043e\u0432\u0430 \u0447\u0442\u043e-\u0442\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u043b\u0438 \u0438 \u0441\u043d\u043e\u0432\u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u0447\u0438\u0441\u043b\u043e:  <\/p>\n<pre><code class=\"python\">&gt;&gt;&gt; b = e*10e307 &gt;&gt;&gt; b inf<\/code><\/pre>\n<p>  \u0420\u0430\u0437\u043d\u043e\u0441\u0442\u044c <b>a<\/b> \u0438 <b>b<\/b> \u0432\u0435\u0440\u043d\u0435\u0442 NaN:<\/p>\n<pre><code class=\"python\">&gt;&gt;&gt; c = a - b &gt;&gt;&gt; c nan<\/code><\/pre>\n<p>  \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u043f\u0440\u0438\u0447\u0438\u043d\u0430, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u0447\u0438\u0442\u0430\u0442\u044c <b>c<\/b> \u043d\u0435 \u0447\u0438\u0441\u043b\u043e\u043c, \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\u043e\u0432\u0430\u043b\u0438 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0442\u043e\u0447\u043d\u044b\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f. \u041e\u0434\u043d\u0430\u043a\u043e, \u0432 <b>c<\/b> \u043f\u043e\u0434 NaN \u0432\u0441\u0435 \u0436\u0435 \u0441\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a\u043e\u0435-\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435. \u041e \u0442\u043e\u043c, \u0447\u0442\u043e \u044d\u0442\u043e \u0437\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043c\u044b \u043d\u0435 \u0437\u043d\u0430\u0435\u043c. \u041d\u043e \u0432\u0441\u0435 \u0436\u0435 \u044d\u0442\u043e \u0447\u0438\u0441\u043b\u043e, \u0430 \u0440\u0430\u0437 \u044d\u0442\u043e \u0447\u0438\u0441\u043b\u043e, \u0442\u043e \u043d\u0435\u0442 \u043d\u0438\u0447\u0435\u0433\u043e \u0443\u0434\u0438\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e <b>pow(1, NaN)=1<\/b>.<\/p>\n<p>  \u041f\u043e\u0447\u0435\u043c\u0443 \u0436\u0435 \u0442\u043e\u0433\u0434\u0430 <b>pow(0, NaN)=NaN<\/b>? \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0432\u043e\u0437\u0432\u0435\u0441\u0442\u0438 0 \u0432 \u043b\u044e\u0431\u0443\u044e \u0441\u0442\u0435\u043f\u0435\u043d\u044c, \u0442\u043e \u043c\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043d\u043e\u043b\u044c. \u041a\u0440\u043e\u043c\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u043b\u0443\u0447\u0430\u044f \u2014 \u043a\u043e\u0433\u0434\u0430 \u0441\u0442\u0435\u043f\u0435\u043d\u044c \u0440\u0430\u0432\u043d\u0430 0:<\/p>\n<pre><code class=\"python\">&gt;&gt;&gt; 0**0 1<\/code><\/pre>\n<p>  \u0418\u0437-\u0437\u0430 \u0447\u0435\u0433\u043e \u0432 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0438 <b>pow(0, NaN)<\/b> \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0441 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c NaN. \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043f\u043e\u0434 NaN \u043c\u043e\u0436\u0435\u0442 \u0441\u043a\u0440\u044b\u0432\u0430\u0442\u044c\u0441\u044f 0 \u2014 \u0438\u0441\u0447\u0435\u0437\u0430\u044e\u0449\u0435 \u043c\u0430\u043b\u0430 \u0438 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u043f\u0440\u0438\u043d\u044f\u0442\u044c, \u0447\u0442\u043e <b>pow(0, NaN)=0<\/b>. \u041d\u043e \u0432\u0441\u0435 \u0436\u0435 \u043b\u0443\u0447\u0448\u0435 \u043f\u0435\u0440\u0435\u0441\u0442\u0440\u0430\u0445\u043e\u0432\u0430\u0442\u044c\u0441\u044f, \u043c\u0430\u043b\u043e \u043b\u0438 \u043a \u0447\u0435\u043c\u0443 \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0442\u0430\u043a \u0438 \u0440\u0430\u0441\u0441\u0443\u0436\u0434\u0430\u043b\u0438, \u043a\u043e\u0433\u0434\u0430 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u043b\u0438\u0441\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u044b.<\/p>\n<p>  \u0414\u0430\u0436\u0435 \u043d\u0435 \u0437\u043d\u0430\u044e, \u0447\u0442\u043e \u0435\u0449\u0435 \u0441\u043a\u0430\u0437\u0430\u0442\u044c\u2026 \u0435\u0441\u043b\u0438 \u0432\u044b \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u0437\u043d\u0430\u043b\u0438 \u043e\u0442\u0432\u0435\u0442, \u0442\u043e \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u0432\u0430\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0437\u0430\u0432\u0438\u0434\u043e\u0432\u0430\u0442\u044c, \u0432\u0435\u0434\u044c \u0441\u0444\u0435\u0440\u044b, \u0433\u0434\u0435 \u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0442\u0430\u043a\u0438\u0435 \u043f\u043e\u0437\u043d\u0430\u043d\u0438\u044f, \u043d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430, \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u044b \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u043c\u0438 \u0437\u0430\u0434\u0430\u0447\u0430\u043c\u0438. \u0410 \u043c\u043e\u0436\u0435\u0442 \u0438 \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442. \u041d\u0430\u043f\u0438\u0448\u0438\u0442\u0435 \u043e\u0431 \u044d\u0442\u043e\u043c \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445.<\/p>\n<p>  P.S. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 NaN \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a \u0447\u0438\u0441\u043b\u0430\u043c \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0442\u043e\u0447\u043a\u043e\u0439, \u043e\u043d\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043a\u043b\u044e\u0447\u043e\u043c \u0441\u043b\u043e\u0432\u0430\u0440\u044f:<\/p>\n<pre><code class=\"python\">&gt;&gt;&gt; d = {0.1: 'a', nan: 'b'} &gt;&gt;&gt; d[nan] 'b'<\/code><\/pre>\n<p>  \u0418\u043c\u0435\u0435\u0442 \u043b\u0438 \u0441\u043c\u044b\u0441\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0435 \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435? \u0414\u0443\u043c\u0430\u044e, \u0447\u0442\u043e \u043b\u0443\u0447\u0448\u0435 \u043d\u0435 \u0441\u0442\u043e\u0438\u0442.<\/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\/post\/530112\/\"> https:\/\/habr.com\/ru\/post\/530112\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/dy\/zw\/00\/dyzw005iudrhrajc0xv4fe7857e.png\" alt=\"image\"><\/p>\n<p>  \u0421\u043d\u0430\u0447\u0430\u043b\u0430, \u044f \u043f\u043e\u0434\u0443\u043c\u0430\u043b, \u0447\u0442\u043e \u044d\u0442\u043e \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 \u0432\u043e\u043f\u0440\u043e\u0441 \u0438\u0437 \u0442\u0435\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0438. \u041d\u0430\u0432\u0435\u0440\u043d\u043e\u0435, \u0435\u0441\u043b\u0438 \u043a\u0430\u043a \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043f\u043e\u0440\u0430\u0441\u043a\u0438\u043d\u0443\u0442\u044c \u043c\u043e\u0437\u0433\u0430\u043c\u0438, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0433\u0430\u0434\u0430\u0442\u044c\u0441\u044f \u0434\u043e \u0442\u043e\u0433\u043e, \u043a\u0430\u043a\u0438\u043c \u0431\u0443\u0434\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442. \u041e\u0442\u043a\u0438\u043d\u0443\u0432\u0448\u0438\u0441\u044c \u043d\u0430 \u0441\u043f\u0438\u043d\u043a\u0443 \u043a\u0440\u0435\u0441\u043b\u0430, \u043d\u0430\u0447\u0430\u043b \u0440\u0430\u0437\u043c\u044b\u0448\u043b\u044f\u0442\u044c, \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443, \u0432\u0441\u043f\u043e\u043c\u0438\u043d\u0430\u0442\u044c \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c, \u043d\u0430 \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0435\u0440\u0435\u0442\u044c\u0441\u044f \u0432 \u0440\u0430\u0441\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u044f\u0445. \u041d\u043e \u0442\u0449\u0435\u0442\u043d\u043e! \u0412\u0434\u0440\u0443\u0433 \u0441\u0442\u0430\u043b\u043e \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u043d\u0430\u0439\u0442\u0438 \u043e\u0442\u0432\u0435\u0442 \u043d\u0435 \u0443\u0434\u0430\u0435\u0442\u0441\u044f. \u041d\u043e \u043f\u043e\u0447\u0435\u043c\u0443? \u0412 \u0447\u0435\u043c \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u0431\u044b\u043b \u043d\u0430\u0439\u0434\u0435\u043d? \u0412 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0435? \u0412 \u044f\u0437\u044b\u043a\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f?  <\/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-313866","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/313866","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=313866"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/313866\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=313866"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=313866"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=313866"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}