{"id":444193,"date":"2025-01-08T03:01:17","date_gmt":"2025-01-08T03:01:17","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=444193"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2025-01-08T03:01:17","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=444193","title":{"rendered":"<span>LibMPU (\u0414\u043b\u0438\u043d\u043d\u0430\u044f \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u043a\u0430)<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0430 \u043a\u0430\u043a \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430 \u0441 \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u043e\u0432 \u0438 \u0444\u043b\u0430\u0433\u043e\u0432, \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c\u044b\u0445 \u043f\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439. \u041d\u0430\u0431\u043e\u0440 \u0446\u0435\u043b\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435, \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0441\u0434\u0432\u0438\u0433\u0430. \u0414\u043b\u044f \u0432\u0435\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0438 \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0441\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0442\u0440\u0438\u0433\u043e\u043d\u043e\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<p>\u0420\u0430\u0437\u0440\u044f\u0434\u043d\u043e\u0441\u0442\u044c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0430\u00a0<strong>65536<\/strong>\u00a0\u0431\u0438\u0442 \u0434\u043b\u044f \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0438\u00a0<strong>16384<\/strong>\u00a0\u0431\u0438\u0442 \u0434\u043b\u044f \u0442\u0440\u0438\u0433\u043e\u043d\u043e\u043c\u0435\u0442\u0440\u0438\u0438. \u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u043e\u0431\u0443\u0441\u043b\u043e\u0432\u043b\u0435\u043d\u044b \u043f\u043e\u0440\u044f\u0434\u043a\u043e\u043c \u0440\u044f\u0434\u043e\u0432 \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438.<\/p>\n<h3>\u0424\u043e\u0440\u043c\u0430\u0442\u044b \u0434\u0430\u043d\u043d\u044b\u0445<\/h3>\n<p>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0446\u0435\u043b\u044b\u0435, \u0432\u0435\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0438 \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0441\u043d\u044b\u0435 \u0442\u0438\u043f\u044b. \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0430\u0445 \u0431\u0430\u0439\u0442\u043e\u0432.<\/p>\n<h4>\u0426\u0435\u043b\u044b\u0435 \u0447\u0438\u0441\u043b\u0430<\/h4>\n<p>\u0412 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435\u00a0<strong>libmpu.h<\/strong>\u00a0\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0431\u0430\u0439\u0442\u043e\u0432 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0446\u0435\u043b\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445:<\/p>\n<pre><code class=\"cpp\">#define NB_I8           1 #define NB_I16          2 #define NB_I32          4 #define NB_I64          8 #define NB_I128        16 #define NB_I256        32 #define NB_I512        64 #define NB_I1024      128 #define NB_I2048      256 #define NB_I4096      512 #define NB_I8192     1024 #define NB_I16384    2048 #define NB_I32768    4096 #define NB_I65536    8192 #define NB_I_MAX     8192<\/code><\/pre>\n<p>\u0414\u0430\u043d\u043d\u044b\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u00a0<strong>nb<\/strong>\u00a0\u0434\u043b\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0441 \u0446\u0435\u043b\u044b\u043c\u0438 \u0447\u0438\u0441\u043b\u0430\u043c\u0438.<\/p>\n<p>\u0412 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445 \u0441\u00a0<strong>big-endian<\/strong>\u00a0\u043f\u043e\u0440\u044f\u0434\u043a\u043e\u043c \u0431\u0430\u0439\u0442\u043e\u0432 \u0441\u0442\u0430\u0440\u0448\u0438\u0439 \u0431\u0430\u0439\u0442 \u0447\u0438\u0441\u043b\u0430 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u043f\u043e \u043d\u0430\u0438\u043c\u0435\u043d\u044c\u0448\u0435\u043c\u0443 \u0430\u0434\u0440\u0435\u0441\u0443 \u043f\u0430\u043c\u044f\u0442\u0438, \u0430 \u043c\u043b\u0430\u0434\u0448\u0438\u0439 \u0431\u0430\u0439\u0442 \u2013 \u043f\u043e \u043d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0435\u043c\u0443. \u0412 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0441\u00a0<strong>little-endian<\/strong>\u00a0\u043f\u043e\u0440\u044f\u0434\u043a\u043e\u043c \u0431\u0430\u0439\u0442\u043e\u0432, \u043d\u0430\u043f\u0440\u043e\u0442\u0438\u0432, \u043c\u043b\u0430\u0434\u0448\u0438\u0439 \u0431\u0430\u0439\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u043f\u043e \u043d\u0430\u0438\u043c\u0435\u043d\u044c\u0448\u0435\u043c\u0443 \u0430\u0434\u0440\u0435\u0441\u0443.<\/p>\n<p>\u041d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0445\u0435\u043c\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043e \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0446\u0435\u043b\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u043c\u0430\u0448\u0438\u043d\u044b:<\/p>\n<pre><code class=\"cpp\">if( MPU_BYTE_ORDER_BIG_ENDIAN == 0 ) {       [NB-1],                      . . . ,                       [0];       +--------------------------- . . . ---------------------------+       |  high                                                  low  |       +--------------------------- . . . ---------------------------+        ^Sign bit   size:                                                           NB. }  if( MPU_BYTE_ORDER_BIG_ENDIAN == 1 ) {       [0],                         . . . ,                    [NB-1];       +--------------------------- . . . ---------------------------+       |  high                                                  low  |       +--------------------------- . . . ---------------------------+        ^Sign bit   size:                                                           NB. }<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c, \u0441\u0438\u043c\u0432\u043e\u043b <strong>NB<\/strong> \u2013 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0431\u0430\u0439\u0442\u043e\u0432 \u0447\u0438\u0441\u043b\u0430.<\/p>\n<p>\u0414\u043b\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0446\u0435\u043b\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432\u044b \u0431\u0430\u0439\u0442\u043e\u0432 \u043b\u044e\u0431\u044b\u043c \u0438\u0437 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0445 \u043d\u0438\u0436\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432:<\/p>\n<pre><code class=\"cpp\">  __mpu_byte_t   a[NB_I65536];   mpu_int        a[NB_I65536];    mpu_int       *a = (mpu_int *)malloc( NB_I65536 * sizeof(__mpu_byte_t) );<\/code><\/pre>\n<p>\u0430 \u0442\u0430\u043a\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u043f\u0440\u0435\u0434\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0432\u00a0<strong>libmpu.h<\/strong>\u00a0\u0442\u0438\u043f\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u044f\u043c\u043e \u0433\u043e\u0432\u043e\u0440\u044f\u0442 \u043e \u0440\u0430\u0437\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u0438:<\/p>\n<pre><code class=\"cpp\">  mpu_int4096_t  a;<\/code><\/pre>\n<p>\u0426\u0435\u043b\u044b\u0435 \u0447\u0438\u0441\u043b\u0430 \u043c\u043e\u0433\u0443\u0442 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u0430\u043a \u0437\u043d\u0430\u043a\u043e\u0432\u044b\u0435 (signed), \u0442\u0430\u043a \u0438 \u0431\u0435\u0437\u0437\u043d\u0430\u043a\u043e\u0432\u044b\u0435 (unsigned). \u0417\u043d\u0430\u043a\u043e\u0432\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0441 \u043d\u0438\u043c\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0432 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u043c \u043a\u043e\u0434\u0435. \u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 8-\u0440\u0430\u0437\u0440\u044f\u0434\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0432 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u043c \u043a\u043e\u0434\u0435.<\/p>\n<pre><code>      +---------------+------------------+       |  \u0414\u0435\u0441\u044f\u0442\u0438\u0447\u043d\u043e\u0435   |      \u0414\u0432\u043e\u0438\u0447\u043d\u043e\u0435    |       | \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 |   \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435  |       +---------------+------------------+       |      127      |     0111 1111    |       |        3      |     0000 0011    |       |        2      |     0000 0010    |       |        1      |     0000 0001    |       |        0      |     0000 0000    |       |       -1      |     1111 1111    |       |       -2      |     1111 1110    |       |       -3      |     1111 1101    |       |     -127      |     1000 0001    |       |     -128      |     1000 0000    |       +---------------+------------------+<\/code><\/pre>\n<h4>\u0412\u0435\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0447\u0438\u0441\u043b\u0430<\/h4>\n<p>\u0412\u0435\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u0442\u0430\u043a\u0436\u0435 \u043a\u0430\u043a \u0438 \u0446\u0435\u043b\u044b\u0435, \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 \u0432\u0438\u0434\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u0431\u0430\u0439\u0442\u043e\u0432. \u0412 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435\u00a0<strong>libmpu.h<\/strong>\u00a0\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0431\u0430\u0439\u0442\u043e\u0432 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0432\u0435\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445:<\/p>\n<pre><code class=\"cpp\">#define NB_R32          4 #define NB_R64          8 #define NB_R128        16 #define NB_R256        32 #define NB_R512        64 #define NB_R1024      128 #define NB_R2048      256 #define NB_R4096      512 #define NB_R8192     1024 #define NB_R16384    2048 #define NB_R32768    4096 #define NB_R65536    8192 #define NB_R_MAX     8192<\/code><\/pre>\n<p>\u0414\u0430\u043d\u043d\u044b\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u00a0<strong>nb<\/strong>\u00a0\u0434\u043b\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0441 \u0432\u0435\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c\u0438 \u0447\u0438\u0441\u043b\u0430\u043c\u0438.<\/p>\n<p>\u0412\u0435\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0447\u0438\u0441\u043b\u0430 \u0438\u043c\u0435\u044e\u0442 \u0432 \u0441\u0432\u043e\u0435\u043c \u0441\u043e\u0441\u0442\u0430\u0432\u0435 \u0434\u0432\u0430 \u043f\u043e\u043b\u044f: \u0441\u043c\u0435\u0449\u0435\u043d\u043d\u043e\u0439 \u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0438 \u043c\u0430\u043d\u0442\u0438\u0441\u0441\u044b. \u0411\u0438\u0442 \u0446\u0435\u043b\u043e\u0439 \u0435\u0434\u0438\u043d\u0438\u0446\u044b \u043d\u0435\u044f\u0432\u043d\u044b\u0439. \u0417\u043d\u0430\u043a \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d \u0432 \u0441\u0442\u0430\u0440\u0448\u0435\u043c \u0431\u0438\u0442\u0435 \u0447\u0438\u0441\u043b\u0430.<\/p>\n<p>\u041d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0445\u0435\u043c\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043e \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0432\u0435\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u043c\u0430\u0448\u0438\u043d\u044b:<\/p>\n<pre><code class=\"cpp\">if( MPU_BYTE_ORDER_BIG_ENDIAN == 0 ) {       [NB-1], . . . , [nS] | [nS-1],        . . . ,              [0];       +------ . . . -------+--------------- . . . ------------------+       | Sign  + Exponent   |              Significand               |       +------ . . . -------+--------------- . . . ------------------+        ^Sign bit           ^(1. - implicit)   size:                  nE                                       nS. }  if( MPU_BYTE_ORDER_BIG_ENDIAN == 1 ) {       [0],  . . . , [nE-1] \u2502 [nE],          . . . ,           [NB-1];       +------ . . . -------+--------------- . . . ------------------+       | Sign  + Exponent   |              Significand               |       +------ . . . -------+--------------- . . . ------------------+        ^Sign bit           ^(1. - implicit)   size:                  nE                                       nS. }<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c, \u0441\u0438\u043c\u0432\u043e\u043b\u044b\u00a0<strong>nE<\/strong>\u00a0\u0438\u00a0<strong>nS<\/strong>\u00a0\u2013 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u044e\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0431\u0430\u0439\u0442\u043e\u0432 \u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0431\u0430\u0439\u0442\u043e\u0432 \u043c\u0430\u043d\u0442\u0438\u0441\u0441\u044b, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e.<\/p>\n<p>\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0431\u0438\u0442 \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u043c\u043e\u0435 \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u043a\u0430, \u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0438 \u043c\u0430\u043d\u0442\u0438\u0441\u0441\u044b \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code>      +-----------------------+-------------------+-------------+       |  \u041e\u0431\u0449\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0431\u0438\u0442 | (Sign + Exponent) | Significand |       +-----------------------+-------------------+-------------+       |                32     |  1  +       8   + |       23    |       |                64     |  1  +      11   + |       52    |       |               128     |  1  +      31   + |       96    |       |               256     |  1  +      31   + |      224    |       |               512     |  1  +      63   + |      448    |       |              1024     |  1  +      63   + |      960    |       |              2048     |  1  +     127   + |     1920    |       |              4096     |  1  +     127   + |     3968    |       |              8192     |  1  +     255   + |     7936    |       |             16384     |  1  +     255   + |    16128    |       |             32768     |  1  +     511   + |    32256    |       |             65536     |  1  +     511   + |    65024    |       +-----------------------+-------------------+-------------+<\/code><\/pre>\n<p>\u0424\u043e\u0440\u043c\u0430\u0442\u044b 32- \u0438 64-\u0431\u0438\u0442\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0442 \u0441\u00a0<strong>IEEE<\/strong>\u00a0(Institute of Electrical and Electronics Engineers) \u0444\u043e\u0440\u043c\u0430\u0442\u043e\u043c.<\/p>\n<p>\u0414\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0434\u0435\u043a\u043b\u0430\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0432\u0435\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435\u00a0<strong>libmpu.h<\/strong>\u00a0\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0442\u0438\u043f\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"cpp\">    mpu_real16384_t  a, b;<\/code><\/pre>\n<h4>\u0411\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0441\u0442\u0438, \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0441\u0442\u044c, \u043d\u0435 \u0447\u0438\u0441\u043b\u0430, \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0435 \u0438 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0435 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u044b<\/h4>\n<p>\u0414\u043b\u044f \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u0447\u0438\u0441\u0435\u043b \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0442\u043e\u0447\u043a\u043e\u0439 \u043d\u0430\u0440\u044f\u0434\u0443 \u0441 \u043e\u0431\u044b\u0447\u043d\u044b\u043c\u0438 \u0432\u0435\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c\u0438 \u0447\u0438\u0441\u043b\u0430\u043c\u0438 \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439. \u041e\u043d\u0438 \u0438\u043c\u0435\u044e\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u0441\u043c\u044b\u0441\u043b \u0438 \u0434\u0430\u044e\u0442 \u0432\u0430\u0436\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e\u0431 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430\u0445 \u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f\u0445, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u043e\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u044d\u0442\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u041a \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c \u043e\u0442\u043d\u043e\u0441\u044f\u0442\u0441\u044f \u0432\u0435\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0447\u0438\u0441\u043b\u0430 \u0441 \u043d\u0430\u0440\u0443\u0448\u0435\u043d\u0438\u0435\u043c \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0441\u0442\u044c, \u043d\u0443\u043b\u0438, \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0441\u0442\u0438 \u0438 \u043d\u0435 \u0447\u0438\u0441\u043b\u0430, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u0435.<\/p>\n<pre><code>      +------+-------------------+-------------------+------------------+       | Sign |      Exponent     |    Significand    |   comments       |       +------+-------------------+-------------------+------------------+       |   S  |  1111 . . . 1111  |  0000 . . . 0000  |   +\/- inf        |       |   S  |  0000 . . . 0000  |  0000 . . . 0000  |   +\/- 0          |       |   1  |  1111 . . . 1111  |  1000 . . . 0000  |     - ind        |       |   S  |  1111 . . . 1111  |  0000 . . . 0001  |   +\/- NaN (min)  |       |   S  |  1111 . . . 1111  |  1111 . . . 1111  |   +\/- NaN (max)  |       +------+-------------------+-------------------+------------------+        \u0417\u0434\u0435\u0441\u044c:         +\/- inf         \u2013  +\/- \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0441\u0442\u044c;         +\/- 0           \u2013  +\/- \u0437\u043d\u0430\u043a\u043e\u0432\u044b\u0439 \u043d\u0443\u043b\u044c;           - ind         \u2013      \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0441\u0442\u044c;         +\/- NaN (min)   \u2013  +\/- \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043d\u0435 \u0447\u0438\u0441\u043b\u043e;         +\/- NaN (max)   \u2013  +\/- \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043d\u0435 \u0447\u0438\u0441\u043b\u043e.<\/code><\/pre>\n<p>\u0427\u0438\u0441\u043b\u0430 \u0441 \u043d\u0430\u0440\u0443\u0448\u0435\u043d\u0438\u0435\u043c \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438:<\/p>\n<pre><code>      +------+-------------------+-------------------+------------------+       | Sign |      Exponent     |    Significand    |   comments       |       +------+-------------------+-------------------+------------------+       |   S  |  0000 . . . 0000  |  0000 . . . 0001  |   +\/- min        |       |   S  |  0000 . . . 0000  |  1111 . . . 1111  |   +\/- max        |       +------+-------------------+-------------------+------------------+<\/code><\/pre>\n<p>\u041a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0430 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0438 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0435\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b:<\/p>\n<pre><code>      +------+-------------------+-------------------+------------------+       | Sign |      Exponent     |    Significand    |   comments       |       +------+-------------------+-------------------+------------------+       |   S  |  0000 . . . 0001  |  0000 . . . 0000  |   +\/- MIN        |       |   S  |  1111 . . . 1110  |  1111 . . . 1111  |   +\/- MAX        |       +------+-------------------+-------------------+------------------+<\/code><\/pre>\n<h4>\u041a\u043e\u043c\u043f\u043b\u0435\u043a\u0441\u043d\u044b\u0435 \u0447\u0438\u0441\u043b\u0430<\/h4>\n<p>\u041a\u043e\u043c\u043f\u043b\u0435\u043a\u0441\u043d\u044b\u0435 \u0447\u0438\u0441\u043b\u0430 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u043c\u0430\u0448\u0438\u043d\u044b \u043a\u0430\u043a \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430, \u0441\u043e\u0441\u0442\u043e\u044f\u0449\u0430\u044f \u0438\u0437 \u0434\u0432\u0443\u0445 \u0432\u0435\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b.<\/p>\n<p>\u041a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0449\u0438\u0435 \u0440\u0430\u0437\u043c\u0435\u0440 \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0441\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b \u0432 \u0431\u0430\u0439\u0442\u0430\u0445, \u0437\u0430\u0434\u0430\u043d\u044b \u0442\u0430\u043a, \u0447\u0442\u043e \u043e\u043d\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u0443 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0441\u043d\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430:<\/p>\n<pre><code class=\"cpp\">#define NB_C32          4 #define NB_C64          8 #define NB_C128        16 #define NB_C256        32 #define NB_C512        64 #define NB_C1024      128 #define NB_C2048      256 #define NB_C4096      512 #define NB_C8192     1024 #define NB_C16384    2048 #define NB_C32768    4096 #define NB_C65536    8192 #define NB_C_MAX     8192<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u0432\u0430\u0436\u043d\u043e \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0435 \u0441 \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0441\u043d\u044b\u043c\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0449\u0435\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440 \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u043e\u0432 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0442 \u0438\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u0438 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u044b. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0442\u0438\u043f\u0430\u00a0mpu_complex256_t, \u043d\u0430 \u0432\u0445\u043e\u0434 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043d\u0430\u0434\u043e \u043f\u043e\u0434\u0430\u0432\u0430\u0442\u044c\u00a0nb = 32 == NB_C256, \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f, \u043a\u0430\u043a\u00a0sizeof(mpu_complex256_t) == 64 == NB_C256 * 2.<\/p>\n<p>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0441\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0445\u0435\u043c\u0435:<\/p>\n<pre><code class=\"cpp\">if( MPU_BYTE_ORDER_BIG_ENDIAN == 0 ) {       [NB*2-1],     . . . ,     [NB] \u2502 [NB-1],     . . . ,       [0];       +------------ . . . -----------+------------ . . . -----------+       |           Real part          |           Imaginary          |       +------------ . . . -----------+------------ . . . -----------+   size:            NB_Real == NB_CXXX             NB_Imag == NB_CXXX. }  if( MPU_BYTE_ORDER_BIG_ENDIAN == 1 ) {       [0],          . . . ,   [NB-1] \u2502 [NB],       . . . ,  [NB*2-1];       +------------ . . . -----------+------------ . . . -----------+       |           Real part          |           Imaginary          |       +------------ . . . -----------+------------ . . . -----------+   size:            NB_Real == NB_CXXX             NB_Imag == NB_CXXX. }<\/code><\/pre>\n<p>\u0424\u043e\u0440\u043c\u0430\u0442\u044b \u0432\u0435\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0438 \u043c\u043d\u0438\u043c\u043e\u0439 \u0447\u0430\u0441\u0442\u0435\u0439 \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0441\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0442 \u0441 \u0444\u043e\u0440\u043c\u0430\u0442\u0430\u043c\u0438 \u0432\u0435\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b.<\/p>\n<h3>\u0424\u043b\u0430\u0433\u0438<\/h3>\n<p>\u0411\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0441 \u0446\u0435\u043b\u044b\u043c\u0438 \u0438 \u0432\u0435\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c\u0438 \u0447\u0438\u0441\u043b\u0430\u043c\u0438 \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0444\u043b\u0430\u0433\u0438. \u0424\u043b\u0430\u0433\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u044b \u0432 \u0446\u0435\u043b\u043e\u0439 32-\u0431\u0438\u0442\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439. \u041c\u043b\u0430\u0434\u0448\u0438\u0435 8 \u0431\u0438\u0442\u043e\u0432 [7 &#8230; 0] \u043e\u0442\u0434\u0430\u043d\u044b \u043f\u043e\u0434 \u0444\u043b\u0430\u0433\u0438 \u0446\u0435\u043b\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439. \u0411\u0438\u0442\u044b \u0441 8-\u0433\u043e \u043f\u043e 15-\u0439 \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0442 \u0444\u043b\u0430\u0433\u0438, \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f\u043c\u0438 \u0441 \u0432\u0435\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c\u0438 \u0447\u0438\u0441\u043b\u0430\u043c\u0438.<\/p>\n<pre><code>               15    14    13    12    11    10     9     8     7     6     5     4     3     2     1     0     . . . -+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ \u00a0            | INX | IND | PLS | TLS | UDF | OVF | SNG | DOM |  V  |  R  |  Z  |  P  |  S  |  O  |  C  |  A  | \u00a0     . . . -+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+ \u00a0<\/code><\/pre>\n<p>\u0424\u043b\u0430\u0433\u0438 \u0446\u0435\u043b\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439:<\/p>\n<pre><code>        A - Auxiliary Carry Flag (carry from lowest 4-bit word)         C - Carry Flag         O - Overflow Flag         S - Sign Flag         P - Parity Flag (of lowest significant byte)         Z - Zero Flag         R - major || remainder         V - Invalid operation<\/code><\/pre>\n<p><strong>NOTE<\/strong>: \u0424\u043b\u0430\u0433\u0438\u00a0<strong>A<\/strong>\u00a0\u0438\u00a0<strong>P<\/strong>\u00a0\u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f\u043c\u0438 \u043d\u0430\u0434 8-\u0440\u0430\u0437\u0440\u044f\u0434\u043d\u044b\u043c\u0438 \u0438 16-\u0440\u0430\u0437\u0440\u044f\u0434\u043d\u044b\u043c\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438.<\/p>\n<p>\u0424\u043b\u0430\u0433\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0441 \u0432\u0435\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438:<\/p>\n<pre><code>      DOM - Domain Flag       SNG - Singularity Flag       OVF - Overflow Flag       UDF - Underflow Flag       TLS - TLOSS Flag       PLS - PLOSS Flag       IND - ind-produsing operation Flag       INX - Inexact Flag<\/code><\/pre>\n<p>\u0412 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435\u00a0<strong>libmpu.h<\/strong>\u00a0\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0444\u043b\u0430\u0433\u0430\u043c\u0438, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a \u043e\u0447\u0438\u0441\u0442\u043a\u0430 \u0444\u043b\u0430\u0433\u043e\u0432, \u0441\u0431\u0440\u043e\u0441, \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0444\u043b\u0430\u0433\u043e\u0432, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0444\u043b\u0430\u0433\u043e\u0432 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439.<\/p>\n<h3>\u0418\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0438 \u043a\u043e\u0434\u044b \u043e\u0448\u0438\u0431\u043e\u043a<\/h3>\n<p>\u041f\u043e\u043c\u0438\u043c\u043e \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0444\u043b\u0430\u0433\u043e\u0432 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f\u043c\u0438 \u0441 \u0446\u0435\u043b\u044b\u043c\u0438 \u0438 \u0432\u0435\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c\u0438 \u0447\u0438\u0441\u043b\u0430\u043c\u0438, \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 libmpu \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e errno \u0438, \u043a\u0442\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435\u00a0__mpu_integer_error_no,\u00a0__mpu_real_error_no,\u00a0__mpu_complex_error_no,\u00a0__mpu_math_error_no.<\/p>\n<p>\u041a\u043e\u0434\u044b \u043e\u0448\u0438\u0431\u043e\u043a \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435\u00a0<strong>libmpu.h<\/strong>.<\/p>\n<p>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u00a0<strong>libmpu<\/strong>\u00a0\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043e\u0448\u0438\u0431\u043e\u043a \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0438\u00a0__mpu_math_error(), \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u043e\u0432\u043a\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0442\u0430\u043a, \u043a\u0430\u043a \u044d\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438\u00a0matherr()\u00a0\u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u043e\u0432\u043a\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c \u0441\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 \u044f\u0437\u044b\u043a\u0430\u00a0<strong>C<\/strong>\u00a0(\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440,\u00a0<strong>GNU Libc<\/strong>).<\/p>\n<p>\u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e\u00a0__mpu_warning(), \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0430\u0445.<\/p>\n<p>\u041a\u0430\u043a \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438\u00a0matherr()\u00a0\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u044f\u0437\u044b\u043a\u0430\u00a0<strong>C<\/strong>, \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0439\u00a0__mpu_math_error(),\u00a0__mpu_warning()\u00a0\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443\u00a0__exception:<\/p>\n<pre><code class=\"cpp\">struct __exception {    int             who;      \/* _COMPLEX_, _REAL_, _INTEGER_, _MATH_ *\/     int             type;    __mpu_char8_t  *name;    __mpu_char8_t  *msg;    int             msg_type; \/* &gt;= 1 - error, 0 - warning *\/     int             nb_a1;    \/* number of bytes in arg_1        *\/    int             nb_a2;    \/* number of bytes in arg_2        *\/    int             nb_rv;    \/* number of bytes in return_value *\/     unsigned char  *arg_1;    unsigned char  *arg_2;    unsigned char  *return_value; };<\/code><\/pre>\n<p>\u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b: \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u043e\u0448\u0438\u0431\u043a\u0438, \u0442\u0438\u043f \u043e\u0448\u0438\u0431\u043a\u0438, \u0438\u043c\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u0438\u0432\u0435\u043b\u043e \u043a \u043e\u0448\u0438\u0431\u043a\u0435, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0438 \u043d\u0430 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435.<\/p>\n<p>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438\u00a0__mpu_utf8mpu_error()\u00a0\u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u0443\u044e \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0443, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0443\u044e \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043e\u0448\u0438\u0431\u043a\u0438, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0435 \u043a\u043e\u0434\u0443 \u043e\u0448\u0438\u0431\u043a\u0438 (\u0441\u043c. \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435\u00a0__mpu_integer_error_no,\u00a0__mpu_real_error_no,\u00a0__mpu_complex_error_no,\u00a0__mpu_math_error_no).<\/p>\n<p>\u0414\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u043d\u0435 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438\u00a0matherr(),\u00a0__mpu_math_error()\u00a0\u0438\u00a0__mpu_warning(), \u043e\u0434\u043d\u0430\u043a\u043e \u043c\u044b \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u043b\u0438 \u0442\u0430\u043a\u0443\u044e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043a\u0430\u043a \u043e\u0434\u043d\u0443 \u0438\u0437 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 \u044f\u0437\u044b\u043a\u0430\u00a0<strong>C<\/strong>.<\/p>\n<h3>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434<\/h3>\n<p>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438\u00a0<a href=\"https:\/\/cgit.radix-linux.su\/libs\/libmpu.git\/\" rel=\"noopener noreferrer nofollow\"><strong>libmpu.git<\/strong><\/a>, \u0433\u0434\u0435 \u0432 \u0444\u0430\u0439\u043b\u0435\u00a0<a href=\"https:\/\/cgit.radix-linux.su\/libs\/libmpu.git\/trunk\/README.md\/\" rel=\"noopener noreferrer nofollow\"><strong>README.md<\/strong><\/a>\u00a0\u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b\u0447\u0438c\u043b\u0435\u043d\u0438\u0439.<\/p>\n<p>\u0412\u044b\u043f\u0443\u0441\u043a\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u044e\u0449\u0438\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f\u00a0<strong>.\/bootstrap<\/strong>, \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435\u00a0<a href=\"https:\/\/ftp.radix-linux.su\/libmpu\/releases\/\" rel=\"noopener noreferrer nofollow\"><strong>releases<\/strong><\/a>\u00a0\u043d\u0430 FTP-\u0441\u0435\u0440\u0432\u0435\u0440\u0435.<\/p>\n<p>\u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0437\u0435\u0440\u043a\u0430\u043b\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f\u00a0<a href=\"https:\/\/cgit.radix-linux.su\/libs\/libmpu.git\/\" rel=\"noopener noreferrer nofollow\"><strong>libmpu.git<\/strong><\/a>\u00a0\u043d\u0430 \u0440\u0435\u0441\u0443\u0440\u0441\u0435\u00a0<a href=\"https:\/\/gitflic.ru\/project\/radix\/libmpu\/\" rel=\"noopener noreferrer nofollow\"><strong>GitFlic.ru<\/strong><\/a>. \u0417\u0434\u0435\u0441\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0441\u043c\u043e\u0433\u0443\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c pull-request-\u044b \u043d\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f.<\/p>\n<h3>\u0421\u0431\u043e\u0440\u043a\u0430<\/h3>\n<p>\u0421\u0431\u043e\u0440\u043a\u0430 \u0438 \u0438\u043d\u0441\u0442\u0430\u043b\u043b\u044f\u0446\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043d\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u0435\u00a0<strong>GNU<\/strong>\/<strong>Linux<\/strong>\u00a0\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u0430, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0443\u0442\u0438\u043b\u0438\u0442\u00a0<strong>Autoconf<\/strong>,\u00a0<strong>Automake<\/strong>:<\/p>\n<pre><code class=\"bash\">wget https:\/\/ftp.radix-linux.su\/libmpu\/releases\/libmpu-1.0.14.tar.xz  mkdir build cd build  ..\/libmpu-1.0.14\/configure \\    --prefix=\/usr \\    --libdir=\/usr\/lib64 \\    --enable-static=no  make make install<\/code><\/pre>\n<p>\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u0440\u044f\u0434\u043d\u043e\u0441\u0442\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0439:\u00a0<strong>&#8212;with-real-io-limit<\/strong>\u00a0\u0438\u00a0<strong>&#8212;with-real-math-f-limit<\/strong>. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u044b:<\/p>\n<pre><code class=\"bash\">..\/libmpu-1.0.14\/configure --help<\/code><\/pre>\n<h3>\u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f<\/h3>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u0431\u043e\u0440\u043a\u0443 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0430\u0440\u043a\u0442\u0430\u043d\u0433\u0435\u043d\u0441\u0430 \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f \u0441 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e\u00a0<strong>16384<\/strong>\u00a0\u0431\u0438\u0442.<\/p>\n<p>\u0421\u043e\u0441\u0442\u0430\u0432\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 Make-\u0444\u0430\u0439\u043b:<\/p>\n<pre><code class=\"cmake\">CC = gcc  CFLAGS  = `mpu-config cflags` LDFLAGS = `mpu-config --ldflags` LIBS    = `mpu-config --libs` -lpthread  SOURCES = main.c OBJECTS = main.o  all: main  .SUFFIXES: .SUFFIXES: .o .c %.o : %.c \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$(CC) $(CFLAGS) -c -o $@ $&lt;  main: $(OBJECTS) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0$(CC) $(LDFLAGS) -o main $(OBJECTS) $(LIBS)  clean: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0rm -f main *.o <\/code><\/pre>\n<p>\u0438 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435\u00a0<strong>\u0421<\/strong>\u00a0\u0432 \u0444\u0430\u0439\u043b\u0435\u00a0<strong>main.c<\/strong>:<\/p>\n<pre><code class=\"cpp\">#include &lt;libmpu.h&gt; #include &lt;stdio.h&gt;  int main( void ) {   int  rc = 0;    __mpu_init();   __mpu_extra_warnings = 1;    {     mpu_real16384_t r, d;     int             nb = NB_R16384;     __mpu_char8_t   s[6000]; \/* size can be obtained by _real_max_string( NB_R16384 ) function *\/      ascii_to_real( r, \"1.0\", nb ); \/* evaluate the R variable *\/     ascii_to_real( d, \"1.0\", nb ); \/* evaluate the D variable *\/      r_atan2( r, r, d, nb );     \/* arc tangent function of R \/ D and place result to the R variable *\/     real_to_ascii( s, r, _real_mant_digs(nb), 'E', 0, 0, nb ); \/* convert R value to ASCII string S *\/     printf( \"s = %s\\n\\nrc = %d;\\n\", s, rc );   }    __mpu_free_context();    return( rc ); }<\/code><\/pre>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u0432 \u0441\u0431\u043e\u0440\u043a\u0443 \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0432 \u043d\u0430\u0448\u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443\u00a0<strong>main<\/strong>:<\/p>\n<pre><code class=\"bash\">make .\/main<\/code><\/pre>\n<p>\u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0432\u044b\u0432\u043e\u0434 \u043d\u0430 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b:<\/p>\n<pre><code class=\"bash\"> s = 7.853981633974483096156608458198757210492923498437764552437361480769541015715522496570087063355292669955370216283205766617734611523876455579313398520321202793625710256754846302763899111557372387325954911072027439164833615321189120584466957913178004772864121417308650871526135816620533484018150622853184311467516515788970437203802302407073135229288410919731475900028326326372051166303460367379853779023582643175914398979882730465293454831529482762796370186155949906873918379714381812228069845457529872824584183406101641607715053487365988061842976755449652359256926348042940732941880961687046169173512830001420317863158902069464428356894474022934092946803671102253062383575366373963427626980699223147308855049890280322554902160086045399534074436928274901296768028374999995932445124877649329332040240796487561148638367270756606305770633361712588154827970427525007844596882216468833020953551542944172868258995633726071888671827898907159705884468984379894454644451330428067016532504819691527989773041050497345238143002663714658197164840383454569920575754880088254632422489434056498534728124304438208697828788937143106135376739877073832792154319639722687745954386593662348298137651002319254177847524622060032145904008909269150261775454857388990497366919593623620638449436817117760118836615520116710647673728233284192572472880261880405142415060145095375483778133456075088969100618741183159785498181510674806991955886954090023354304103049811465787575715457436389266874596263736471467317489227318026993773257388302913362468006889900591201663747799704586994383915924518566356319656379546043936682227444431984500204117650040363122980433043036930875353604933921370403402893381380333689354623671096308309768485358336369406042156297458923713905248048055460681375635642219179476236504133667012471568081979465214460959569919941703635252384709465902376700160562813012793482462240210321221567364010604913212555526652965766860696555097987362617809284467402390910929793218669411643934906034727164581614989533476195068975248664410197378173670995881489274564556551306223519316798695671206503692477256600340986093638262670508740631129373499128578574522976648127343054241153789274645968526494714899432438747325404384821170345671709672356935389979639813114884898577624931311702114968184111739621634591840556565247811520128109710976128110341374406951994289228589994250324040223604237171389621015883555180564571221620396140071265042106848630668669197238130346306374886666819559966141490290887215576443641245088984086420435810281287690173698627741490235063072199277232864172842168071872351400253758271544821702302186902294562346472524287274189963153413874454732824462054207497371806647012143910035676193887830949103628809365585911357146111988164669552627853386839348807783567915255339923840578607381212342967775364413508975699836009355018276446347655495968619521196224208303614284671879858766075546132977621202513426536701687298195477994849880153549158571886101609362809295480449995977539798904536687856728099372352267966235579903919863020237866375563079009704825355234405344639891597344467707597674480193366805456406499153753553757670096119336373006513536664813003743607126831296665005331085220476776215829336624128634764490671402513770266646992495408936840960131428647757242660350277428015701097599398789192894251050844674840018076396907940898554682812867801332320479565465314668303947996037122072911176523938176739305229391779180727745422728820043376678187145805717958802338491431280270894787842470522861052516877583667775785316777842477164629099578754925412877921292859414404587889127212274974649955968363820829088769119796339733065463724080332332724642660511688147677288703541374648654092950677454985774811222393928207226480808315243249280211083933163723455977983149365916826459010357034707580095622593974631093604257283191404523443361007676867302800478255082595049405275275112323303790210611214909417459738071711957808881645532862394214315608360473259921606560852693306744507018297288602752611705813179050263163068027915099166393273136777639463440866705163277474131729655141192328142646589155046395251823401649691215294776133372125865284144216883123604170099066449469296390211382413531663521326535861079646692437864153517001750594694147836004281873676051405576347486403285177817501019636833174847703636661614701993177066707658582146964245763089522332664393516988642909438135505287389403953500625315571485325541178877448148077476991368440313794141878393794574166136947936252824903722576159986783240526835109379739339903647254847428277947607445714118758007996728785071770214976200273530368053294869119431556035637136350830392963265355720343962607658304379574496655592930397901929173136871847466637373625286635157108415984475099423164180365963266840241428022951909581791604068722200196731400725571180260079302965205104750105741542799094480334393778739875391512407965736816368410631E-1   rc = 0;<\/code><\/pre>\n<p>\u0412\u0441\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438, \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 <strong>LibMPU<\/strong>, \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0441 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435 <strong>libmpu.h<\/strong>. \u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043b\u0438\u0448\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437 \u043d\u0438\u0445.<\/p>\n<h3>\u0421\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u0432\u044b\u0447\u0438\u0442\u0430\u043d\u0438\u0435<\/h3>\n<p>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u044b \u0447\u0435\u0442\u044b\u0440\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0432\u044b\u0447\u0438\u0442\u0430\u043d\u0438\u044f \u0446\u0435\u043b\u044b\u0445 \u0447\u0438\u0441\u0435\u043b. \u0414\u0432\u0435 \u0438\u0437 \u043d\u0438\u0445,\u00a0<strong>iadd()<\/strong>,\u00a0<strong>isub()<\/strong>, \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0444\u043b\u0430\u0433 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0430 (<strong>C<\/strong>). \u0412 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a \u0434\u0432\u0435 \u0434\u0440\u0443\u0433\u0438\u0435,\u00a0<strong>iadc()<\/strong>,\u00a0<strong>isbb()<\/strong>, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0444\u043b\u0430\u0433 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0430 (<strong>C<\/strong>), \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0435\u0439.<\/p>\n<h4>iadd()<\/h4>\n<pre><code class=\"cpp\">#include &lt;libmpu.h&gt;  void iadd( mpu_int *c, mpu_int *a, mpu_int *b, int nb );<\/code><\/pre>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f\u00a0<strong>iadd()<\/strong>\u00a0\u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0446\u0435\u043b\u044b\u0445 \u0447\u0438\u0441\u0435\u043b, \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0445 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0430\u043c\u00a0<strong>a<\/strong>\u00a0\u0438\u00a0<strong>b<\/strong>, c \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443\u00a0<strong>c<\/strong>. \u041e\u043f\u0435\u0440\u0430\u043d\u0434\u044b \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0447\u0438\u0441\u043b\u0430\u043c\u0438 \u0441\u043e \u0437\u043d\u0430\u043a\u043e\u043c \u0438\u043b\u0438 \u0431\u0435\u0437 \u043d\u0435\u0433\u043e. \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0430\u043c\u00a0<strong>a<\/strong>,\u00a0<strong>b<\/strong>\u00a0\u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f, \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443\u00a0<strong>c<\/strong>\u00a0\u0442\u0435\u0440\u044f\u0435\u0442\u0441\u044f. \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u00a0<strong>nb<\/strong>\u00a0\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0440 \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u043e\u0432 (\u0432 \u0431\u0430\u0439\u0442\u0430\u0445), \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0445 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0430\u043c\u00a0<strong>c<\/strong>,\u00a0<strong>a<\/strong>,\u00a0<strong>b<\/strong>.<\/p>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043e\u0437\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0430 \u0444\u043b\u0430\u0433\u0438\u00a0<strong>A<\/strong>,\u00a0<strong>C<\/strong>,\u00a0<strong>O<\/strong>,\u00a0<strong>P<\/strong>,\u00a0<strong>S<\/strong>,\u00a0<strong>Z<\/strong>\u00a0\u0438\u00a0<strong>V<\/strong>.<\/p>\n<p>\u0424\u043b\u0430\u0433\u0438\u00a0<strong>\u0410<\/strong>\u00a0\u0438\u00a0<strong>P<\/strong>\u00a0\u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043a\u043e\u0433\u0434\u0430 \u0440\u0430\u0437\u043c\u0435\u0440 \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u043e\u0432\u00a0<strong>a<\/strong>,\u00a0<strong>b<\/strong>\u00a0\u0440\u0430\u0432\u0435\u043d \u043e\u0434\u043d\u043e\u043c\u0443 \u0438\u043b\u0438 \u0434\u0432\u0443\u043c \u0431\u0430\u0439\u0442\u0430\u043c (<strong>nb == 1 || nb == 2<\/strong>).<\/p>\n<p><strong>\u041f\u0440\u0438\u043c\u0435\u0440<\/strong><\/p>\n<pre><code class=\"cpp\">#include &lt;libmpu.h&gt; #include &lt;stdio.h&gt;  int main( void ) {   int  rc = 0;    __mpu_init();   __mpu_extra_warnings = 1;    {     mpu_int128_t   c, a, b;     int            nb = NB_I128;     __mpu_char8_t  s[256];      iatoi( a, \"237\", nb ); \/* evaluate the A variable *\/     iatoi( b,  \"37\", nb ); \/* evaluate the B variable *\/      iadd( c, a, b, nb );     iitoa( s, c, RADIX_DEC, LOWERCASE, nb ); \/* convert C value to ASCII string S *\/     printf( \"c = %s;\\n\", s ); \/* c = 274; *\/   }    __mpu_free_context();    return( rc ); }<\/code><\/pre>\n<h4>isub()<\/h4>\n<pre><code class=\"cpp\">#include &lt;libmpu.h&gt;  void isub( mpu_int *c, mpu_int *a, mpu_int *b, int nb );<\/code><\/pre>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f\u00a0<strong>isub()<\/strong>\u00a0\u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u0432\u044b\u0447\u0438\u0442\u0430\u043d\u0438\u044f \u0446\u0435\u043b\u044b\u0445 \u0447\u0438\u0441\u0435\u043b, \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0445 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0430\u043c\u00a0<strong>a<\/strong>\u00a0\u0438\u00a0<strong>b<\/strong>, c \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443\u00a0<strong>c<\/strong>. \u041e\u043f\u0435\u0440\u0430\u043d\u0434\u044b \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0447\u0438\u0441\u043b\u0430\u043c\u0438 \u0441\u043e \u0437\u043d\u0430\u043a\u043e\u043c \u0438\u043b\u0438 \u0431\u0435\u0437 \u043d\u0435\u0433\u043e. \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0430\u043c\u00a0<strong>a<\/strong>,\u00a0<strong>b<\/strong>\u00a0\u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f, \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443\u00a0<strong>c<\/strong>\u00a0\u0442\u0435\u0440\u044f\u0435\u0442\u0441\u044f. \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u00a0<strong>nb<\/strong>\u00a0\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0440 \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u043e\u0432 (\u0432 \u0431\u0430\u0439\u0442\u0430\u0445), \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0445 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0430\u043c\u00a0<strong>c<\/strong>,\u00a0<strong>a<\/strong>,\u00a0<strong>b<\/strong>.<\/p>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043e\u0437\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0430 \u0444\u043b\u0430\u0433\u0438\u00a0<strong>A<\/strong>,\u00a0<strong>C<\/strong>,\u00a0<strong>O<\/strong>,\u00a0<strong>P<\/strong>,\u00a0<strong>S<\/strong>,\u00a0<strong>Z<\/strong>\u00a0\u0438\u00a0<strong>V<\/strong>.<\/p>\n<p>\u0424\u043b\u0430\u0433\u0438\u00a0<strong>\u0410<\/strong>\u00a0\u0438\u00a0<strong>P<\/strong>\u00a0\u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043a\u043e\u0433\u0434\u0430 \u0440\u0430\u0437\u043c\u0435\u0440 \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u043e\u0432\u00a0<strong>a<\/strong>,\u00a0<strong>b<\/strong>\u00a0\u0440\u0430\u0432\u0435\u043d \u043e\u0434\u043d\u043e\u043c\u0443 \u0438\u043b\u0438 \u0434\u0432\u0443\u043c \u0431\u0430\u0439\u0442\u0430\u043c (<strong>nb == 1 || nb == 2<\/strong>).<\/p>\n<p><strong>\u041f\u0440\u0438\u043c\u0435\u0440<\/strong><\/p>\n<pre><code class=\"cpp\">#include &lt;libmpu.h&gt; #include &lt;stdio.h&gt;  int main( void ) {   int  rc = 0;    __mpu_init();   __mpu_extra_warnings = 1;    {     mpu_int128_t   c, a, b;     int            nb = NB_I128;     __mpu_char8_t  s[256];      iatoi( a, \"237\", nb ); \/* evaluate the A variable *\/     iatoi( b,  \"37\", nb ); \/* evaluate the B variable *\/      isub( c, a, b, nb );     iitoa( s, c, RADIX_DEC, LOWERCASE, nb ); \/* convert C value to ASCII string S *\/     printf( \"c = %s;\\n\", s ); \/* c = 200; *\/   }    __mpu_free_context();    return( rc ); }<\/code><\/pre>\n<h4>iadc()<\/h4>\n<pre><code class=\"cpp\">#include &lt;libmpu.h&gt;  void iad\u0441( mpu_int *c, mpu_int *a, mpu_int *b, int nb );<\/code><\/pre>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f\u00a0<strong>iadc()<\/strong>\u00a0\u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0446\u0435\u043b\u044b\u0445 \u0447\u0438\u0441\u0435\u043b, \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0445 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0430\u043c\u00a0<strong>a<\/strong>\u00a0\u0438\u00a0<strong>b<\/strong>, \u043a \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0439 \u0441\u0443\u043c\u043c\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0444\u043b\u0430\u0433\u0430 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0430 (<strong>C<\/strong>) \u0438 \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443\u00a0<strong>c<\/strong>. \u041e\u043f\u0435\u0440\u0430\u043d\u0434\u044b \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0447\u0438\u0441\u043b\u0430\u043c\u0438 \u0441\u043e \u0437\u043d\u0430\u043a\u043e\u043c \u0438\u043b\u0438 \u0431\u0435\u0437 \u043d\u0435\u0433\u043e. \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0430\u043c\u00a0<strong>a<\/strong>,\u00a0<strong>b<\/strong>\u00a0\u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f, \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443\u00a0<strong>c<\/strong>\u00a0\u0442\u0435\u0440\u044f\u0435\u0442\u0441\u044f. \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u00a0<strong>nb<\/strong>\u00a0\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0440 \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u043e\u0432 (\u0432 \u0431\u0430\u0439\u0442\u0430\u0445), \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0445 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0430\u043c\u00a0<strong>c<\/strong>,\u00a0<strong>a<\/strong>,\u00a0<strong>b<\/strong>. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u00a0<strong>iadc()<\/strong>\u00a0\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0444\u043b\u0430\u0433 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0430 (<strong>C<\/strong>), \u0442\u043e \u043e\u043d\u0430 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0447\u0438\u0441\u0435\u043b, \u0434\u043b\u0438\u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0435\u0442 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u0435 \u0440\u0430\u0437\u043c\u0435\u0440\u044b \u0446\u0435\u043b\u044b\u0445 \u0447\u0438\u0441\u0435\u043b.<\/p>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043e\u0437\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0430 \u0444\u043b\u0430\u0433\u0438\u00a0<strong>A<\/strong>,\u00a0<strong>C<\/strong>,\u00a0<strong>O<\/strong>,\u00a0<strong>P<\/strong>,\u00a0<strong>S<\/strong>,\u00a0<strong>Z<\/strong>\u00a0\u0438\u00a0<strong>V<\/strong>.<\/p>\n<p>\u0424\u043b\u0430\u0433\u0438\u00a0<strong>\u0410<\/strong>\u00a0\u0438\u00a0<strong>P<\/strong>\u00a0\u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043a\u043e\u0433\u0434\u0430 \u0440\u0430\u0437\u043c\u0435\u0440 \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u043e\u0432\u00a0<strong>a<\/strong>,\u00a0<strong>b<\/strong>\u00a0\u0440\u0430\u0432\u0435\u043d \u043e\u0434\u043d\u043e\u043c\u0443 \u0438\u043b\u0438 \u0434\u0432\u0443\u043c \u0431\u0430\u0439\u0442\u0430\u043c (<strong>nb == 1 || nb == 2<\/strong>).<\/p>\n<p><strong>\u041f\u0440\u0438\u043c\u0435\u0440<\/strong><\/p>\n<pre><code class=\"cpp\">#include &lt;libmpu.h&gt; #include &lt;stdio.h&gt;  int main( void ) {   int  rc = 0;    __mpu_init();   __mpu_extra_warnings = 1;    {     mpu_int128_t   c, a, b;     int            nb = NB_I128;     __mpu_char8_t  s[256];      iatoi( a, \"237\", nb ); \/* evaluate the A variable *\/     iatoi( b,  \"37\", nb ); \/* evaluate the B variable *\/      __mpu_stc(); \/* Set Carry Flag *\/      iadc( c, a, b, nb );     iitoa( s, c, RADIX_DEC, LOWERCASE, nb ); \/* convert C value to ASCII string S *\/     printf( \"c = %s;\\n\", s ); \/* c = 275; *\/   }    __mpu_free_context();    return( rc ); }<\/code><\/pre>\n<h4>isbb()<\/h4>\n<pre><code class=\"cpp\">#include &lt;libmpu.h&gt;  void isbb( mpu_int *c, mpu_int *a, mpu_int *b, int nb );<\/code><\/pre>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f\u00a0<strong>isbb()<\/strong>\u00a0\u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u0432\u044b\u0447\u0438\u0442\u0430\u043d\u0438\u044f \u0446\u0435\u043b\u044b\u0445 \u0447\u0438\u0441\u0435\u043b, \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0445 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0430\u043c\u00a0<strong>a<\/strong>\u00a0\u0438\u00a0<strong>b<\/strong>, \u0438\u0437 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0439 \u0440\u0430\u0437\u043d\u043e\u0441\u0442\u0438 \u0432\u044b\u0447\u0438\u0442\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0444\u043b\u0430\u0433\u0430 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0430 (<strong>C<\/strong>) \u0438 \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443\u00a0<strong>c<\/strong>. \u041e\u043f\u0435\u0440\u0430\u043d\u0434\u044b \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0447\u0438\u0441\u043b\u0430\u043c\u0438 \u0441\u043e \u0437\u043d\u0430\u043a\u043e\u043c \u0438\u043b\u0438 \u0431\u0435\u0437 \u043d\u0435\u0433\u043e. \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0430\u043c\u00a0<strong>a<\/strong>,\u00a0<strong>b<\/strong>\u00a0\u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f, \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443\u00a0<strong>c<\/strong>\u00a0\u0442\u0435\u0440\u044f\u0435\u0442\u0441\u044f. \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u00a0<strong>nb<\/strong>\u00a0\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0440 \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u043e\u0432 (\u0432 \u0431\u0430\u0439\u0442\u0430\u0445), \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0445 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0430\u043c\u00a0<strong>c<\/strong>,\u00a0<strong>a<\/strong>,\u00a0<strong>b<\/strong>. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u00a0<strong>isbb()<\/strong>\u00a0\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0444\u043b\u0430\u0433 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0430 (<strong>C<\/strong>), \u0442\u043e \u043e\u043d\u0430 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0432\u044b\u0447\u0438\u0442\u0430\u043d\u0438\u044f \u0447\u0438\u0441\u0435\u043b, \u0434\u043b\u0438\u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0435\u0442 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u0435 \u0440\u0430\u0437\u043c\u0435\u0440\u044b \u0446\u0435\u043b\u044b\u0445 \u0447\u0438\u0441\u0435\u043b.<\/p>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043e\u0437\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0430 \u0444\u043b\u0430\u0433\u0438\u00a0<strong>A<\/strong>,\u00a0<strong>C<\/strong>,\u00a0<strong>O<\/strong>,\u00a0<strong>P<\/strong>,\u00a0<strong>S<\/strong>,\u00a0<strong>Z<\/strong>\u00a0\u0438\u00a0<strong>V<\/strong>.<\/p>\n<p>\u0424\u043b\u0430\u0433\u0438\u00a0<strong>\u0410<\/strong>\u00a0\u0438\u00a0<strong>P<\/strong>\u00a0\u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043a\u043e\u0433\u0434\u0430 \u0440\u0430\u0437\u043c\u0435\u0440 \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u043e\u0432\u00a0<strong>a<\/strong>,\u00a0<strong>b<\/strong>\u00a0\u0440\u0430\u0432\u0435\u043d \u043e\u0434\u043d\u043e\u043c\u0443 \u0438\u043b\u0438 \u0434\u0432\u0443\u043c \u0431\u0430\u0439\u0442\u0430\u043c (<strong>nb == 1 || nb == 2<\/strong>).<\/p>\n<p><strong>\u041f\u0440\u0438\u043c\u0435\u0440<\/strong><\/p>\n<pre><code class=\"cpp\">#include &lt;libmpu.h&gt; #include &lt;stdio.h&gt;  int main( void ) {   int  rc = 0;    __mpu_init();   __mpu_extra_warnings = 1;    {     mpu_int128_t   c, a, b;     int            nb = NB_I128;     __mpu_char8_t  s[256];      iatoi( a, \"237\", nb ); \/* evaluate the A variable *\/     iatoi( b,  \"37\", nb ); \/* evaluate the B variable *\/      __mpu_stc(); \/* Set Carry Flag *\/      isbb( c, a, b, nb );     iitoa( s, c, RADIX_DEC, LOWERCASE, nb ); \/* convert C value to ASCII string S *\/     printf( \"c = %s;\\n\", s ); \/* c = 199; *\/   }    __mpu_free_context();    return( rc ); }<\/code><\/pre>\n<h3>\u0421\u0434\u0432\u0438\u0433\u0438<\/h3>\n<pre><code class=\"cpp\">#include &lt;libmpu.h&gt;  void ishl( mpu_int *c, mpu_int *a, int nb ); void ishr( mpu_int *c, mpu_int *a, int nb ); void isal( mpu_int *c, mpu_int *a, int nb ); void isar( mpu_int *c, mpu_int *a, int nb );<\/code><\/pre>\n<p>\u0414\u043b\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0441\u0434\u0432\u0438\u0433\u043e\u0432 \u043d\u0430 \u043e\u0434\u0438\u043d \u0431\u0438\u0442 \u0432\u0445\u043e\u0434\u043d\u044b\u043c \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u043e\u043c \u0441\u043b\u0443\u0436\u0438\u0442 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c\u00a0<strong>nb<\/strong>\u00a0\u0431\u0430\u0439\u0442, \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0430\u044f\u0441\u044f \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443\u00a0<strong>a<\/strong>. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0442\u043e\u0433\u043e \u0436\u0435 \u0440\u0430\u0437\u043c\u0435\u0440\u0430, \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u0443\u044e \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443\u00a0<strong>c<\/strong>. \u041f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430, \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u043c\u044b\u0435 \u0432\u0445\u043e\u0434\u043d\u043e\u0439 \u0438 \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u043c\u043e\u0433\u0443\u0442 \u043f\u0435\u0440\u0435\u0441\u0435\u043a\u0430\u0442\u044c\u0441\u044f, \u043a\u0430\u043a \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e, \u0442\u0430\u043a \u0438 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e, \u0447\u0442\u043e \u043d\u0435 \u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c\u043e\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430. \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439, \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0439 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443\u00a0<strong>a<\/strong>\u00a0\u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u043d\u044b\u043c \u043f\u043e\u0441\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438, \u0435\u0441\u043b\u0438 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u043c\u043e\u0435 \u0435\u044e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u043d\u0435 \u043f\u0435\u0440\u0435\u0441\u0435\u043a\u0430\u0435\u0442\u0441\u044f \u0441 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e\u043c, \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u043c\u044b\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439\u00a0<strong>c<\/strong>.<\/p>\n<p>\u041f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0441\u0434\u0432\u0438\u0433\u0430, \u0444\u043b\u0430\u0433 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0430 (<strong>C<\/strong>) \u0432\u0441\u0435\u0433\u0434\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u0432\u044b\u0434\u0432\u0438\u043d\u0443\u0442\u043e\u0433\u043e \u0431\u0438\u0442\u0430. \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0432\u0438\u0434\u044b \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0441\u0434\u0432\u0438\u0433\u0430:<\/p>\n<ul>\n<li>\n<p><strong>SHL<\/strong>\u00a0\u2013 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0431\u0435\u0437\u0437\u043d\u0430\u043a\u043e\u0432\u044b\u0439 \u0441\u0434\u0432\u0438\u0433 \u0432\u043b\u0435\u0432\u043e \u043d\u0430 \u043e\u0434\u0438\u043d \u0431\u0438\u0442.<\/p>\n<\/li>\n<li>\n<p><strong>SHR<\/strong>\u00a0\u2013 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0431\u0435\u0437\u0437\u043d\u0430\u043a\u043e\u0432\u044b\u0439 \u0441\u0434\u0432\u0438\u0433 \u0432\u043f\u0440\u0430\u0432\u043e \u043d\u0430 \u043e\u0434\u0438\u043d \u0431\u0438\u0442.<\/p>\n<\/li>\n<li>\n<p><strong>SAL<\/strong>\u00a0\u2013 \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0441\u0434\u0432\u0438\u0433 \u0432\u043b\u0435\u0432\u043e \u043d\u0430 \u043e\u0434\u0438\u043d \u0431\u0438\u0442.<\/p>\n<\/li>\n<li>\n<p><strong>SAR<\/strong>\u00a0\u2013 \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0441\u0434\u0432\u0438\u0433 \u0432\u043f\u0440\u0430\u0432\u043e \u043d\u0430 \u043e\u0434\u0438\u043d \u0431\u0438\u0442.<\/p>\n<\/li>\n<\/ul>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0438\u0440\u0443\u044e\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439\u00a0<strong>ishl()<\/strong>,\u00a0<strong>ishr()<\/strong>.<\/p>\n<pre><code>      +----------------+---+-------------------+------------+       | SHL(&lt;&lt;):       | C | \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u0430 | \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 |       +----------------+---+-------------------+------------+       | \u0434\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438    |   |      10110111     |     0      |       +----------------+---+-------------------+------------+       | \u043f\u043e\u0441\u043b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 | 1 |      01101110     |            |       +----------------+---+-------------------+------------+        +----------------+------------+-------------------+---+       | SHR(&gt;&gt;):       | \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 | \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u0430 | C |       +----------------+------------+-------------------+---+       | \u0434\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438    |     0      |      10110111     |   |       +----------------+------------+-------------------+---+       | \u043f\u043e\u0441\u043b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 |            |      01011011     | 1 |       +----------------+------------+-------------------+---+<\/code><\/pre>\n<p>\u0418\u0437 \u0442\u0430\u0431\u043b\u0438\u0446 \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u043f\u0440\u0438 \u043b\u044e\u0431\u043e\u043c \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u0441\u0434\u0432\u0438\u0433\u0435 \u043d\u0430 \u043e\u0441\u0432\u043e\u0431\u043e\u0434\u0438\u0432\u0448\u0435\u0435\u0441\u044f \u043c\u0435\u0441\u0442\u043e \u0432\u0441\u0435\u0433\u0434\u0430 \u0437\u0430\u0434\u0432\u0438\u0433\u0430\u0435\u0442\u0441\u044f 0. \u0424\u043b\u0430\u0433 \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f (<strong>O<\/strong>) \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f, \u0435\u0441\u043b\u0438 \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043e\u043f\u0435\u0440\u0430\u043d\u0434 \u0438\u0437\u043c\u0435\u043d\u0438\u043b \u0437\u043d\u0430\u043a.<\/p>\n<p>\u041e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0441\u0434\u0432\u0438\u0433\u0430 \u0432\u043b\u0435\u0432\u043e\u00a0<strong>isal()<\/strong>\u00a0\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438\u00a0<strong>ishl()<\/strong>\u00a0(\u0442\u0430\u043a\u0436\u0435 \u043d\u0430 \u043f\u0443\u0441\u0442\u043e\u0435 \u043c\u0435\u0441\u0442\u043e \u0441\u043f\u0440\u0430\u0432\u0430 \u0437\u0430\u0434\u0432\u0438\u0433\u0430\u0435\u0442\u0441\u044f 0). \u041e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0441\u0434\u0432\u0438\u0433\u0430 \u0432\u043f\u0440\u0430\u0432\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u0438\u043d\u0430\u0447\u0435: \u0432 \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0430\u044e\u0449\u0443\u044e\u0441\u044f \u043f\u043e\u0437\u0438\u0446\u0438\u044e \u0441\u043b\u0435\u0432\u0430 \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u043a\u043e\u0432\u044b\u0439 \u0431\u0438\u0442 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u0430. \u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439\u00a0<strong>isal()<\/strong>\u00a0\u0438\u00a0<strong>isar()<\/strong>\u00a0\u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0442\u0430\u0431\u043b\u0438\u0446.<\/p>\n<pre><code>      +----------------+---+-------------------+------------+       | SAL(&lt;&lt;):       | C | \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u0430 | \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 |       +----------------+---+-------------------+------------+       | \u0434\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438    |   |      10110111     |     0      |       +----------------+---+-------------------+------------+       | \u043f\u043e\u0441\u043b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 | 1 |      01101110     |            |       +----------------+---+-------------------+------------+        +----------------+------------+-------------------+---+       | SAR(&gt;&gt;):       | \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 | \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u0430 | C |       +----------------+------------+-------------------+---+       | \u0434\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438    |   sign(1)  |      10110111     |   |       +----------------+------------+-------------------+---+       | \u043f\u043e\u0441\u043b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 |            |      11011011     | 1 |       +----------------+------------+-------------------+---+<\/code><\/pre>\n<p>\u0424\u043b\u0430\u0433 \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438\u00a0<strong>isal()<\/strong>\u00a0\u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u0430\u043a\u0438\u043c \u0436\u0435 \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043a\u0430\u043a \u0438 \u043f\u0440\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438\u00a0<strong>ishl()<\/strong>. \u041f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438\u00a0<strong>isar()<\/strong>, \u043e\u043f\u0435\u0440\u0430\u043d\u0434 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u0432\u043e\u0439 \u0437\u043d\u0430\u043a. \u041c\u043d\u043e\u0433\u043e\u043a\u0440\u0430\u0442\u043d\u044b\u0439 \u0441\u0434\u0432\u0438\u0433\u00a0<strong>isar()<\/strong>\u00a0\u043c\u043e\u0436\u0435\u0442, \u0432 \u043a\u043e\u043d\u0446\u0435 \u043a\u043e\u043d\u0446\u043e\u0432, \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u043f\u043e\u0442\u0435\u0440\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0438 \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0437\u0430\u0434\u0432\u0438\u043d\u0435\u0442\u0441\u044f \u0432 0, \u0430 \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0432 -1. \u041f\u043e \u044d\u0442\u043e\u043c\u0443 \u0444\u043b\u0430\u0433 \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f (<strong>O<\/strong>) \u0434\u043b\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438\u00a0<strong>isar()<\/strong>\u00a0\u0441\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 0.<\/p>\n<p>\u041f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439\u00a0<strong>isal()<\/strong>,\u00a0<strong>isar()<\/strong>,\u00a0<strong>ishl()<\/strong>,\u00a0<strong>ishr()<\/strong>, \u0442\u0430\u043a \u0436\u0435 \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0444\u043b\u0430\u0433\u0438 \u0447\u0435\u0442\u043d\u043e\u0441\u0442\u0438 (<strong>P<\/strong>), \u0437\u043d\u0430\u043a\u0430 (<strong>S<\/strong>) \u0438 \u043d\u0443\u043b\u044f (<strong>Z<\/strong>). \u0424\u043b\u0430\u0433 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0430 \u0438\u0437 \u043c\u043b\u0430\u0434\u0448\u0435\u0439 \u0442\u0435\u0442\u0440\u0430\u0434\u044b (<strong>A<\/strong>) \u043d\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 0.<\/p>\n<p>\u0421\u0434\u0432\u0438\u0433 \u0432\u043b\u0435\u0432\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u0434\u043b\u044f \u0443\u0434\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u044f \u0447\u0438\u0441\u0435\u043b, \u0430 \u0441\u0434\u0432\u0438\u0433 \u0432\u043f\u0440\u0430\u0432\u043e \u2013 \u0434\u043b\u044f \u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043d\u0430 2. \u042d\u0442\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0447\u0435\u043c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0434\u0435\u043b\u0435\u043d\u0438\u044f. \u0414\u0435\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u043f\u043e\u043b\u0430\u043c \u043d\u0435\u0447\u0435\u0442\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, 5 \u0438\u043b\u0438 7) \u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u043c\u0435\u043d\u044c\u0448\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f (2 \u0438\u043b\u0438 3 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e) \u0438 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u0444\u043b\u0430\u0433 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0430 (<strong>C<\/strong>) \u0432 1. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c\u00a0<strong>C<\/strong>\u00a0\u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043e\u0441\u0442\u0430\u0442\u043e\u043a \u043e\u0442 \u0434\u0435\u043b\u0435\u043d\u0438\u044f. \u0422\u0430\u043a\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0441\u0434\u0432\u0438\u0433\u0430 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u0437\u0430 \u0444\u043b\u0430\u0433\u043e\u043c \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f (<strong>O<\/strong>). \u0414\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b, \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u0444\u043b\u0430\u0433\u043e\u0432 \u043d\u0430 4-\u0431\u0438\u0442\u043d\u044b\u0445 \u0437\u043d\u0430\u043a\u043e\u0432\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445:<\/p>\n<p><strong>\u041f\u0440\u0438\u043c\u0435\u0440\u044b \u0441 4-\u0431\u0438\u0442\u043d\u044b\u043c\u0438 \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u0430\u043c\u0438<\/strong>:<\/p>\n<p><strong>\u0423\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 2<\/strong>:<\/p>\n<pre><code>  SAL(0111) =  7; \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 = 1110 = -2, \u043e\u0448\u0438\u0431\u043a\u0430, \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c 14, CF = 0, OF = 1<\/code><\/pre>\n<p><strong>\u0414\u0435\u043b\u0435\u043d\u0438\u0435 \u043d\u0430 2<\/strong>:<\/p>\n<pre><code>  SHR(1000) = -8; \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 = 0100 =  4, \u043e\u0448\u0438\u0431\u043a\u0430, \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c -4, CF = 0, OF = 1<\/code><\/pre>\n<p><strong>\u0414\u0435\u043b\u0435\u043d\u0438\u0435 \u043d\u0430 2<\/strong>:<\/p>\n<pre><code>  SAR(1000) = -8; \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 = 1100 = -4, \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u0442\u043e\u0447\u043d\u043e, CF = 0, OF = 0<\/code><\/pre>\n<p><strong>\u0414\u0435\u043b\u0435\u043d\u0438\u0435 \u043d\u0430 2<\/strong>:<\/p>\n<pre><code>  SAR(0111) =  7; \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 = 0011 =  3, \u043e\u0441\u0442\u0430\u0442\u043e\u043a 1 (\u0441\u043c. \u0444\u043b\u0430\u0433 C), \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u0442\u043e\u0447\u043d\u043e, CF = 1, OF = 0<\/code><\/pre>\n<p><strong>\u041f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b<\/strong><\/p>\n<pre><code class=\"cpp\">#include &lt;libmpu.h&gt; #include &lt;stdio.h&gt;  int main( void ) {   int  rc = 0;    __mpu_init();   __mpu_extra_warnings = 1;    {     mpu_int8_t     c, a;     int            nb = NB_I8;     __mpu_char8_t  sc[32], sa[32];      iatoi( a, \"0b10110111\", nb ); \/* evaluate the A variable *\/      ishl( c, a, nb );     iitoa( sa, a, RADIX_BIN, LOWERCASE, nb ); \/* convert A value to ASCII string SA *\/     iitoa( sc, c, RADIX_BIN, LOWERCASE, nb ); \/* convert C value to ASCII string SC *\/     printf( \"a = %s;\\n\", sa ); \/* c = 0b10110111; *\/     printf( \"c = %s;\\n\", sc ); \/* c = 0b01101110; *\/     printf( \"carry      = %d;\\n\", __mpu_gtc() );  \/* Carry Flag    *\/     printf( \"overflow   = %d;\\n\", __mpu_gto() );  \/* Overflow Flag *\/   }    __mpu_free_context();    return( rc ); }<\/code><\/pre>\n<h3>\u0426\u0438\u043a\u043b\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0441\u0434\u0432\u0438\u0433\u0438<\/h3>\n<pre><code class=\"cpp\">#include &lt;libmpu.h&gt;  void irol( mpu_int *c, mpu_int *a, int nb ); void iror( mpu_int *c, mpu_int *a, int nb ); void ircl( mpu_int *c, mpu_int *a, int nb ); void ircr( mpu_int *c, mpu_int *a, int nb );<\/code><\/pre>\n<p>\u0414\u043b\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0446\u0438\u043a\u043b\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0441\u0434\u0432\u0438\u0433\u0430 \u043d\u0430 \u043e\u0434\u0438\u043d \u0431\u0438\u0442 \u0432\u0445\u043e\u0434\u043d\u044b\u043c \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u043e\u043c \u0441\u043b\u0443\u0436\u0438\u0442 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c\u00a0<strong>nb<\/strong>\u00a0\u0431\u0430\u0439\u0442, \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0430\u044f\u0441\u044f \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443\u00a0<strong>a<\/strong>. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0442\u043e\u0433\u043e \u0436\u0435 \u0440\u0430\u0437\u043c\u0435\u0440\u0430, \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u0443\u044e \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443\u00a0<strong>c<\/strong>. \u041f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430, \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u043c\u044b\u0435 \u0432\u0445\u043e\u0434\u043d\u043e\u0439 \u0438 \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u043c\u043e\u0433\u0443\u0442 \u043f\u0435\u0440\u0435\u0441\u0435\u043a\u0430\u0442\u044c\u0441\u044f, \u043a\u0430\u043a \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e, \u0442\u0430\u043a \u0438 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e, \u0447\u0442\u043e \u043d\u0435 \u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c\u043e\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430. \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439, \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0439 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443\u00a0<strong>a<\/strong>\u00a0\u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u043d\u0435\u0438\u0437\u043c\u0435\u043d\u043d\u044b\u043c \u043f\u043e\u0441\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438, \u0435\u0441\u043b\u0438 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u043c\u043e\u0435 \u0435\u044e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u043d\u0435 \u043f\u0435\u0440\u0435\u0441\u0435\u043a\u0430\u0435\u0442\u0441\u044f \u0441 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e\u043c, \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u043c\u044b\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439\u00a0<strong>c<\/strong>.<\/p>\n<p>\u041f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0446\u0438\u043a\u043b\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0441\u0434\u0432\u0438\u0433\u0430, \u0444\u043b\u0430\u0433 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0430 (<strong>C<\/strong>) \u0432\u0441\u0435\u0433\u0434\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u0432\u044b\u0434\u0432\u0438\u043d\u0443\u0442\u043e\u0433\u043e \u0431\u0438\u0442\u0430. \u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0432\u0438\u0434\u044b \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0446\u0438\u043a\u043b\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0441\u0434\u0432\u0438\u0433\u0430:<\/p>\n<ul>\n<li>\n<p><strong>ROL<\/strong>\u00a0\u2013 \u0446\u0438\u043a\u043b\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0441\u0434\u0432\u0438\u0433 \u0432\u043b\u0435\u0432\u043e \u043d\u0430 \u043e\u0434\u0438\u043d \u0431\u0438\u0442.<\/p>\n<\/li>\n<li>\n<p><strong>ROR<\/strong>\u00a0\u2013 \u0446\u0438\u043a\u043b\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0441\u0434\u0432\u0438\u0433 \u0432\u043f\u0440\u0430\u0432\u043e \u043d\u0430 \u043e\u0434\u0438\u043d \u0431\u0438\u0442.<\/p>\n<\/li>\n<li>\n<p><strong>RCL<\/strong>\u00a0\u2013 \u0446\u0438\u043a\u043b\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0441\u0434\u0432\u0438\u0433 \u0432\u043b\u0435\u0432\u043e \u043d\u0430 \u043e\u0434\u0438\u043d \u0431\u0438\u0442 \u0441 \u0443\u0447\u0430\u0441\u0442\u0438\u0435\u043c \u0444\u043b\u0430\u0433\u0430 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0430.<\/p>\n<\/li>\n<li>\n<p><strong>RCR<\/strong>\u00a0\u2013 \u0446\u0438\u043a\u043b\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0441\u0434\u0432\u0438\u0433 \u0432\u043f\u0440\u0430\u0432\u043e \u043d\u0430 \u043e\u0434\u0438\u043d \u0431\u0438\u0442 \u0441 \u0443\u0447\u0430\u0441\u0442\u0438\u0435\u043c \u0444\u043b\u0430\u0433\u0430 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0430.<\/p>\n<\/li>\n<\/ul>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0438\u0440\u0443\u044e\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439\u00a0<strong>irol()<\/strong>,\u00a0<strong>iror()<\/strong>.<\/p>\n<pre><code>      +----------------+---+-------------------+------------+       | ROL(&lt;&lt;):       | C | \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u0430 | \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 |       +----------------+---+-------------------+------------+       | \u0434\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438    |   |      10110111     |   sign(1)  |       +----------------+---+-------------------+------------+       | \u043f\u043e\u0441\u043b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 | 1 |      01101111     |            |       +----------------+---+-------------------+------------+        +----------------+------------+-------------------+---+       | ROR(&gt;&gt;):       | \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 | \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u0430 | C |       +----------------+------------+-------------------+---+       | \u0434\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438    | low bit(1) |      10110111     |   |       +----------------+------------+-------------------+---+       | \u043f\u043e\u0441\u043b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 |            |      11011011     | 1 |       +----------------+------------+-------------------+---+<\/code><\/pre>\n<p>\u041e\u043f\u0435\u0440\u0430\u0446\u0438\u0438\u00a0<strong>irol()<\/strong>\u00a0\u0438\u00a0<strong>iror()<\/strong>\u00a0(\u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0441 \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c\u0438 \u0441\u0434\u0432\u0438\u0433\u0430\u00a0<strong>isal()<\/strong>,\u00a0<strong>isar()<\/strong>,\u00a0<strong>ishl()<\/strong>,\u00a0<strong>ishr()<\/strong>) \u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0442 \u043d\u0430 \u0444\u043b\u0430\u0433 \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f (<strong>O<\/strong>) \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0437\u043d\u0430\u043a\u0430 \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u0430. \u0422\u0430\u043a \u0436\u0435 \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0444\u043b\u0430\u0433\u0438 \u0447\u0435\u0442\u043d\u043e\u0441\u0442\u0438 (<strong>P<\/strong>), \u0437\u043d\u0430\u043a\u0430 (<strong>S<\/strong>) \u0438 \u043d\u0443\u043b\u044f (<strong>Z<\/strong>). \u0424\u043b\u0430\u0433 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0430 \u0438\u0437 \u043c\u043b\u0430\u0434\u0448\u0435\u0439 \u0442\u0435\u0442\u0440\u0430\u0434\u044b (<strong>A<\/strong>) \u043d\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 0.<\/p>\n<p>\u0412 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f\u0445\u00a0<strong>ircl()<\/strong>\u00a0\u0438\u00a0<strong>ircr()<\/strong>\u00a0\u0432 \u0441\u0434\u0432\u0438\u0433\u0435 \u0443\u0447\u0430\u0441\u0442\u0432\u0443\u0435\u0442 \u0444\u043b\u0430\u0433 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0430 (<strong>C<\/strong>). \u0412\u044b\u0434\u0432\u0438\u0433\u0430\u0435\u043c\u044b\u0439 \u0438\u0437 \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u0430 \u0431\u0438\u0442 \u0437\u0430\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u0432\u043e \u0444\u043b\u0430\u0433 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0430 (<strong>C<\/strong>) \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u00a0<strong>C<\/strong>\u00a0\u043f\u043e\u0441\u0442\u0443\u043f\u0438\u0442 \u0432 \u043e\u0441\u0432\u043e\u0431\u043e\u0434\u0438\u0432\u0448\u0443\u044e\u0441\u044f \u043f\u043e\u0437\u0438\u0446\u0438\u044e.<\/p>\n<pre><code>      +----------------+---+-------------------+------------+       | RCL(&lt;&lt;):       | C | \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u0430 | \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 |       +----------------+---+-------------------+------------+       | \u0434\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438    | 0 |      10110111     |    C(0)    |       +----------------+---+-------------------+------------+       | \u043f\u043e\u0441\u043b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 | 1 |      01101110     |            |       +----------------+---+-------------------+------------+        +----------------+------------+-------------------+---+       | RCR(&gt;&gt;):       | \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 | \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u043d\u0434\u0430 \u2502 C \u2502       +----------------+------------+-------------------+---+       | \u0434\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438    |    C(0)    |      10110111     | 0 |       +----------------+------------+-------------------+---+       | \u043f\u043e\u0441\u043b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 |            |      01011011     | 1 |       +----------------+------------+-------------------+---+<\/code><\/pre>\n<p>\u041e\u043f\u0435\u0440\u0430\u0446\u0438\u0438\u00a0<strong>ircl()<\/strong>,\u00a0<strong>ircr()<\/strong>\u00a0\u0432\u043e\u0437\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0442 \u043d\u0430 \u0444\u043b\u0430\u0433\u0438 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0430 (<strong>C<\/strong>) \u0438 \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f (<strong>O<\/strong>) \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0432\u0441\u0435\u043c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u043c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f\u043c. \u0424\u043b\u0430\u0433 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0430 \u0438\u0437 \u043c\u043b\u0430\u0434\u0448\u0435\u0439 \u0442\u0435\u0442\u0440\u0430\u0434\u044b (<strong>A<\/strong>) \u043d\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 0.<\/p>\n<p>\u0412\u044b\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0444\u043b\u0430\u0433\u043e\u0432 \u0447\u0435\u0442\u043d\u043e\u0441\u0442\u0438 (<strong>P<\/strong>) \u0438 \u043d\u0443\u043b\u044f (<strong>Z<\/strong>) \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f\u043c\u0438\u00a0<strong>ircl()<\/strong>,\u00a0<strong>ircr()<\/strong>\u00a0\u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u0442\u0438\u043f\u043e\u0432 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439. \u042d\u0442\u043e \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u0438 \u043a \u0444\u043b\u0430\u0433\u0443 \u0437\u043d\u0430\u043a\u0430 (<strong>S<\/strong>). \u0422\u0430\u043a \u043a\u0430\u043a \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438\u00a0<strong>ircl()<\/strong>,\u00a0<strong>ircr()<\/strong>\u00a0\u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0441\u0434\u0432\u0438\u0433\u043e\u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0441\u043b\u043e\u0432 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u043d\u043e \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c\u0438 \u0441\u0434\u0432\u0438\u0433\u0430 \u0438, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u044e\u0442 \u0442\u0430\u043a\u0438\u0435 \u0441\u043e\u0441\u0442\u0430\u0432\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438, \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b, \u043f\u043e\u0441\u043b\u0435 \u0438\u0445 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f, \u0438\u043c\u0435\u0442\u044c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0444\u043b\u0430\u0433\u043e\u0432\u00a0<strong>P<\/strong>\u00a0\u0438\u00a0<strong>Z<\/strong>\u00a0\u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u043c\u0443 \u0441\u0434\u0432\u0438\u0433\u0430\u0435\u043c\u043e\u043c\u0443 \u0441\u043b\u043e\u0432\u0443, \u0430 \u0446\u0435\u043b\u0438\u043a\u043e\u043c \u0432\u0441\u0435\u0439 \u0441\u0434\u0432\u0438\u0433\u0430\u0435\u043c\u043e\u0439 \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u0438 \u0441\u043b\u043e\u0432.<\/p>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f\u00a0<strong>ircr()<\/strong>\u00a0\u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u0432\u043e\u0438 \u0444\u043b\u0430\u0433\u0438 (<strong>P<\/strong>,\u00a0<strong>S<\/strong>), \u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f\u00a0<strong>ircl()<\/strong>\u00a0\u043d\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0441\u0432\u043e\u0438 \u0444\u043b\u0430\u0433\u0438 (<strong>P<\/strong>,\u00a0<strong>S<\/strong>) \u0438 \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442 \u0438\u0445 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439. \u0424\u043b\u0430\u0433 \u043d\u0443\u043b\u044f (<strong>Z<\/strong>) \u043e\u0431\u0435\u0438\u043c\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f\u043c\u0438 (<strong>ircl()<\/strong>,\u00a0<strong>ircr()<\/strong>) \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u00a0<strong>\u041b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u043c\u0443 \u0418<\/strong>\u00a0(<strong>AND<\/strong>) \u0441 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u0444\u043b\u0430\u0433\u0430\u00a0<strong>Z<\/strong>, \u0442\u043e \u0435\u0441\u0442\u044c:<\/p>\n<pre><code>      +----------------+----------------+----------------+       |                |   \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 Z,  |                |       |   \u041f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0435   |   \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0435   | \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0438\u0440\u0443\u044e\u0449\u0435\u0435 |       |   \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 Z   |  \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435  |   \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 Z   |       |                |    \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438    |                |       +----------------+----------------+----------------+       |       1        |       0        |       0        |       +----------------+----------------+----------------+       |       1        |       1        |       1        |       +----------------+----------------+----------------+       |       0        |       0        |       0        |       +----------------+----------------+----------------+       |       0        |       1        |       0        |       +----------------+----------------+----------------+<\/code><\/pre>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0435\u0441\u043b\u0438 \u0432\u0441\u0435 \u0441\u043b\u043e\u0432\u0430, \u0443\u0447\u0430\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0432 \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u0438 \u0441\u0434\u0432\u0438\u0433\u043e\u0432, \u0434\u0430\u043b\u0438 \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u0442\u043e \u0438 \u0444\u043b\u0430\u0433\u00a0<strong>Z<\/strong>\u00a0\u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u0432 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0438\u00a0<strong>\u0418\u0421\u0422\u0418\u041d\u0410<\/strong>, \u0438\u043d\u0430\u0447\u0435, \u0435\u0441\u043b\u0438 \u0445\u043e\u0442\u044f-\u0431\u044b \u043e\u0434\u043d\u043e \u0441\u043b\u043e\u0432\u043e \u0434\u0430\u043b\u043e \u043d\u0435\u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u0444\u043b\u0430\u0433\u00a0<strong>Z<\/strong>\u00a0\u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438\u00a0<strong>\u041b\u041e\u0416\u042c<\/strong>.<\/p>\n<p><strong>\u041f\u0440\u0438\u043c\u0435\u0440\u044b \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439<\/strong>:<\/p>\n<p><strong>\u0421\u0434\u0432\u0438\u0433 \u043f\u0430\u0440\u044b \u0441\u043b\u043e\u0432 \u0432\u043f\u0440\u0430\u0432\u043e<\/strong>:<\/p>\n<p><strong>isar(11111101), ircr(10011010);<\/strong>\u00a0\u043f\u043e\u0441\u043b\u0435\u00a0<strong>isar()<\/strong>\u00a0\u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 = 11111110,\u00a0<strong>C<\/strong>=1,\u00a0<strong>O<\/strong>=0,\u00a0<strong>P<\/strong>=1,\u00a0<strong>Z<\/strong>=0; \u043f\u043e\u0441\u043b\u0435\u00a0<strong>ircr()<\/strong>\u00a0\u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 = 11001101,\u00a0<strong>C<\/strong>=0,\u00a0<strong>O<\/strong>=0,\u00a0<strong>P<\/strong>=0,\u00a0<strong>Z<\/strong>=0. \u041e\u0431\u0449\u0438\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: 1111111011001101. \u0421\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0444\u043b\u0430\u0433\u043e\u0432 \u043f\u043e\u0441\u043b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438\u00a0<strong>ircr()<\/strong>\u00a0\u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0438\u0442 \u043a\u043e \u0432\u0441\u0435\u0439 \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u0438 \u0434\u0432\u0443\u0445 \u0441\u043b\u043e\u0432 (\u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c \u043f\u043e 8 \u0431\u0438\u0442 \u043a\u0430\u0436\u0434\u043e\u0435).<\/p>\n<p><strong>\u0421\u0434\u0432\u0438\u0433 \u043f\u0430\u0440\u044b \u0441\u043b\u043e\u0432 \u0432\u043b\u0435\u0432\u043e<\/strong>:<\/p>\n<p><strong>ircl(00111000), isal(10111111);<\/strong>\u00a0\u043f\u043e\u0441\u043b\u0435\u00a0<strong>isal()<\/strong>\u00a0\u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 = 01111110,\u00a0<strong>C<\/strong>=1,\u00a0<strong>O<\/strong>=1,\u00a0<strong>P<\/strong>=1,\u00a0<strong>Z<\/strong>=0; \u043f\u043e\u0441\u043b\u0435\u00a0<strong>ircl()<\/strong>\u00a0\u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 = 01110001,\u00a0<strong>C<\/strong>=0,\u00a0<strong>O<\/strong>=0,\u00a0<strong>P<\/strong>=1,\u00a0<strong>Z<\/strong>=0. \u041e\u0431\u0449\u0438\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: 0111000101111110. \u0421\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0444\u043b\u0430\u0433\u043e\u0432 \u043f\u043e\u0441\u043b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438\u00a0<strong>isal()<\/strong>\u00a0\u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0438\u0442 \u043a\u043e \u0432\u0441\u0435\u0439 \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u0438 \u0434\u0432\u0443\u0445 \u0441\u043b\u043e\u0432 (\u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c \u043f\u043e 8 \u0431\u0438\u0442 \u043a\u0430\u0436\u0434\u043e\u0435). \u0417\u0430\u043c\u0435\u0442\u0438\u043c, \u0447\u0442\u043e \u0444\u043b\u0430\u0433\u00a0<strong>P<\/strong>\u00a0\u0432\u044b\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0435\u0439\u00a0<strong>isal()<\/strong>\u00a0\u0438 \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u043b\u0441\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0435\u0439\u00a0<strong>ircl()<\/strong>, \u0444\u043b\u0430\u0433\u00a0<strong>Z<\/strong>\u00a0\u043f\u043e\u043b\u0443\u0447\u0435\u043d \u043f\u043e\u00a0<strong>AND<\/strong>\u00a0\u043c\u0435\u0436\u0434\u0443\u00a0<strong>Z<\/strong>\u00a0\u043e\u0442\u00a0<strong>isal()<\/strong>\u00a0\u0438\u00a0<strong>Z<\/strong>\u00a0\u043e\u0442\u00a0<strong>ircl()<\/strong>.<\/p>\n<p><strong>\u041f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b<\/strong><\/p>\n<pre><code class=\"cpp\">#include &lt;libmpu.h&gt; #include &lt;stdio.h&gt;  int main( void ) {   int  rc = 0;    __mpu_init();   __mpu_extra_warnings = 1;    {     mpu_int8_t     c, d, a, b;     mpu_int16_t    z;     mpu_int       *pz = NULL;     __mpu_char8_t  s[32];      pz = (mpu_int *)&amp;z;  #if ( MPU_BYTE_ORDER_BIG_ENDIAN == 1 )     ++pz; #endif      iatoi( b, \"0b10111111\", NB_I8 );  \/* low part  *\/     iatoi( a, \"0b00111000\", NB_I8 );  \/* high part *\/      __mpu_clc(); \/* clear Carry Flag *\/      isal( d, b, NB_I8 );     ircl( c, a, NB_I8 );      icpy( pz, d, NB_I8, NB_I8 ); \/*  low part of Z *\/ #if ( MPU_BYTE_ORDER_BIG_ENDIAN == 1 )     --pz; #else     ++pz; #endif     icpy( pz, c, NB_I8, NB_I8 ); \/* high part of Z *\/      iitoa( s, z, RADIX_BIN, UPPERCASE, NB_I16 ); \/* convert Z value to ASCII string S *\/     printf( \"z = %s;\\n\", s ); \/* z = 0B0111000101111110; *\/     printf( \"carry    = %d;\\n\", __mpu_gtc() );  \/* Carry Flag    *\/     printf( \"overflow = %d;\\n\", __mpu_gto() );  \/* Overflow Flag *\/   }    __mpu_free_context();    return( rc ); }<\/code><\/pre>\n<p>\u041c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0441\u0434\u0432\u0438\u0433\u0430 \u043d\u0430 \u043e\u0434\u0438\u043d \u0431\u0438\u0442. \u041e\u0434\u043d\u0430\u043a\u043e \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435\u00a0<strong>LibMPU<\/strong>\u00a0\u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u044b \u0442\u0430\u043a\u0436\u0435 \u0441\u0434\u0432\u0438\u0433\u0438 \u043d\u0430 N-\u0431\u0438\u0442.<\/p>\n<hr\/>\n<p>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u00a0<strong>LibMPU<\/strong>\u00a0\u043d\u0430\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0441 \u0446\u0435\u043b\u044b\u043c\u0438, \u0432\u0435\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c\u0438 \u0438 \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0441\u043d\u044b\u043c\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438. \u0415\u0441\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u043f\u043e\u043c\u0438\u043c\u043e\u00a0<strong>man(7)<\/strong>\u00a0\u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0430 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u043e\u043d \u0432\u0441\u0435\u0433\u0434\u0430 \u043c\u043e\u0436\u0435\u0442 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043a \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u043c\u0443 \u043a\u043e\u0434\u0443 \u0438 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u043e\u043c\u0443 \u0444\u0430\u0439\u043b\u0443\u00a0<strong>libmpu.h<\/strong>.<\/p>\n<p><strong>\u041a\u043e\u043d\u0442\u0430\u043a\u0442\u044b<\/strong>:<\/p>\n<ul>\n<li>\n<p>Telegram:\u00a0<a href=\"https:\/\/t.me\/rxlinux\/\" rel=\"noopener noreferrer nofollow\">@rxlinux<\/a><\/p>\n<\/li>\n<li>\n<p>E\u2011mail:\u00a0<a href=\"https:\/\/radix-linux.su\/contacts\/\" rel=\"noopener noreferrer nofollow\">Contact Us<\/a><\/p>\n<\/li>\n<li>\n<p>URL:\u00a0<a href=\"https:\/\/radix-linux.su\/\" rel=\"noopener noreferrer nofollow\">https:\/\/radix-linux.su\/<\/a><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/871766\/\"> https:\/\/habr.com\/ru\/articles\/871766\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0430 \u043a\u0430\u043a \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430 \u0441 \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u043e\u0432 \u0438 \u0444\u043b\u0430\u0433\u043e\u0432, \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c\u044b\u0445 \u043f\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439. \u041d\u0430\u0431\u043e\u0440 \u0446\u0435\u043b\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435, \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0441\u0434\u0432\u0438\u0433\u0430. \u0414\u043b\u044f \u0432\u0435\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0438 \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0441\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0442\u0440\u0438\u0433\u043e\u043d\u043e\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<p>\u0420\u0430\u0437\u0440\u044f\u0434\u043d\u043e\u0441\u0442\u044c \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0430\u00a0<strong>65536<\/strong>\u00a0\u0431\u0438\u0442 \u0434\u043b\u044f \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0438\u00a0<strong>16384<\/strong>\u00a0\u0431\u0438\u0442 \u0434\u043b\u044f \u0442\u0440\u0438\u0433\u043e\u043d\u043e\u043c\u0435\u0442\u0440\u0438\u0438. \u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u043e\u0431\u0443\u0441\u043b\u043e\u0432\u043b\u0435\u043d\u044b \u043f\u043e\u0440\u044f\u0434\u043a\u043e\u043c \u0440\u044f\u0434\u043e\u0432 \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438.<\/p>\n<h3>\u0424\u043e\u0440\u043c\u0430\u0442\u044b \u0434\u0430\u043d\u043d\u044b\u0445<\/h3>\n<p>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0446\u0435\u043b\u044b\u0435, \u0432\u0435\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0438 \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0441\u043d\u044b\u0435 \u0442\u0438\u043f\u044b. \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0430\u0445 \u0431\u0430\u0439\u0442\u043e\u0432.<\/p>\n<h4>\u0426\u0435\u043b\u044b\u0435 \u0447\u0438\u0441\u043b\u0430<\/h4>\n<p>\u0412 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435\u00a0<strong>libmpu.h<\/strong>\u00a0\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0431\u0430\u0439\u0442\u043e\u0432 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0446\u0435\u043b\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445:<\/p>\n<pre><code class=\"cpp\">#define NB_I8           1 #define NB_I16          2 #define NB_I32          4 #define NB_I64          8 #define NB_I128        16 #define NB_I256        32 #define NB_I512        64 #define NB_I1024      128 #define NB_I2048      256 #define NB_I4096      512 #define NB_I8192     1024 #define NB_I16384    2048 #define NB_I32768    4096 #define NB_I65536    8192 #define NB_I_MAX     8192<\/code><\/pre>\n<p>\u0414\u0430\u043d\u043d\u044b\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u00a0<strong>nb<\/strong>\u00a0\u0434\u043b\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0441 \u0446\u0435\u043b\u044b\u043c\u0438 \u0447\u0438\u0441\u043b\u0430\u043c\u0438.<\/p>\n<p>\u0412 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0445 \u0441\u00a0<strong>big-endian<\/strong>\u00a0\u043f\u043e\u0440\u044f\u0434\u043a\u043e\u043c \u0431\u0430\u0439\u0442\u043e\u0432 \u0441\u0442\u0430\u0440\u0448\u0438\u0439 \u0431\u0430\u0439\u0442 \u0447\u0438\u0441\u043b\u0430 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u043f\u043e \u043d\u0430\u0438\u043c\u0435\u043d\u044c\u0448\u0435\u043c\u0443 \u0430\u0434\u0440\u0435\u0441\u0443 \u043f\u0430\u043c\u044f\u0442\u0438, \u0430 \u043c\u043b\u0430\u0434\u0448\u0438\u0439 \u0431\u0430\u0439\u0442 \u2013 \u043f\u043e \u043d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0435\u043c\u0443. \u0412 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0441\u00a0<strong>little-endian<\/strong>\u00a0\u043f\u043e\u0440\u044f\u0434\u043a\u043e\u043c \u0431\u0430\u0439\u0442\u043e\u0432, \u043d\u0430\u043f\u0440\u043e\u0442\u0438\u0432, \u043c\u043b\u0430\u0434\u0448\u0438\u0439 \u0431\u0430\u0439\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u043f\u043e \u043d\u0430\u0438\u043c\u0435\u043d\u044c\u0448\u0435\u043c\u0443 \u0430\u0434\u0440\u0435\u0441\u0443.<\/p>\n<p>\u041d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0445\u0435\u043c\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043e \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0446\u0435\u043b\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u043c\u0430\u0448\u0438\u043d\u044b:<\/p>\n<pre><code class=\"cpp\">if( MPU_BYTE_ORDER_BIG_ENDIAN == 0 ) {       [NB-1],                      . . . ,                       [0];       +--------------------------- . . . ---------------------------+       |  high                                                  low  |       +--------------------------- . . . ---------------------------+        ^Sign bit   size:                                                           NB. }  if( MPU_BYTE_ORDER_BIG_ENDIAN == 1 ) {       [0],                         . . . ,                    [NB-1];       +--------------------------- . . . ---------------------------+       |  high                                                  low  |       +--------------------------- . . . ---------------------------+        ^Sign bit   size:                                                           NB. }<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c, \u0441\u0438\u043c\u0432\u043e\u043b <strong>NB<\/strong> \u2013 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0431\u0430\u0439\u0442\u043e\u0432 \u0447\u0438\u0441\u043b\u0430.<\/p>\n<p>\u0414\u043b\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0446\u0435\u043b\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432\u044b \u0431\u0430\u0439\u0442\u043e\u0432 \u043b\u044e\u0431\u044b\u043c \u0438\u0437 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0445 \u043d\u0438\u0436\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432:<\/p>\n<pre><code class=\"cpp\">  __mpu_byte_t   a[NB_I65536];   mpu_int        a[NB_I65536];    mpu_int       *a = (mpu_int *)malloc( NB_I65536 * sizeof(__mpu_byte_t) );<\/code><\/pre>\n<p>\u0430 \u0442\u0430\u043a\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u043f\u0440\u0435\u0434\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0432\u00a0<strong>libmpu.h<\/strong>\u00a0\u0442\u0438\u043f\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u044f\u043c\u043e \u0433\u043e\u0432\u043e\u0440\u044f\u0442 \u043e \u0440\u0430\u0437\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u0438:<\/p>\n<pre><code class=\"cpp\">  mpu_int4096_t  a;<\/code><\/pre>\n<p>\u0426\u0435\u043b\u044b\u0435 \u0447\u0438\u0441\u043b\u0430 \u043c\u043e\u0433\u0443\u0442 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u0430\u043a \u0437\u043d\u0430\u043a\u043e\u0432\u044b\u0435 (signed), \u0442\u0430\u043a \u0438 \u0431\u0435\u0437\u0437\u043d\u0430\u043a\u043e\u0432\u044b\u0435 (unsigned). \u0417\u043d\u0430\u043a\u043e\u0432\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0441 \u043d\u0438\u043c\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0432 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u043c \u043a\u043e\u0434\u0435. \u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 8-\u0440\u0430\u0437\u0440\u044f\u0434\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0432 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u043c \u043a\u043e\u0434\u0435.<\/p>\n<pre><code>      +---------------+------------------+       |  \u0414\u0435\u0441\u044f\u0442\u0438\u0447\u043d\u043e\u0435   |      \u0414\u0432\u043e\u0438\u0447\u043d\u043e\u0435    |       | \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 |   \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435  |       +---------------+------------------+       |      127      |     0111 1111    |       |        3      |     0000 0011    |       |        2      |     0000 0010    |       |        1      |     0000 0001    |       |        0      |     0000 0000    |       |       -1      |     1111 1111    |       |       -2      |     1111 1110    |       |       -3      |     1111 1101    |       |     -127      |     1000 0001    |       |     -128      |     1000 0000    |       +---------------+------------------+<\/code><\/pre>\n<h4>\u0412\u0435\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0447\u0438\u0441\u043b\u0430<\/h4>\n<p>\u0412\u0435\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u0442\u0430\u043a\u0436\u0435 \u043a\u0430\u043a \u0438 \u0446\u0435\u043b\u044b\u0435, \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 \u0432\u0438\u0434\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u0431\u0430\u0439\u0442\u043e\u0432. \u0412 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435\u00a0<strong>libmpu.h<\/strong>\u00a0\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0431\u0430\u0439\u0442\u043e\u0432 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0432\u0435\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445:<\/p>\n<pre><code class=\"cpp\">#define NB_R32          4 #define NB_R64          8 #define NB_R128        16 #define NB_R256        32 #define NB_R512        64 #define NB_R1024      128 #define NB_R2048      256 #define NB_R4096      512 #define NB_R8192     1024 #define NB_R16384    2048 #define NB_R32768    4096 #define NB_R65536    8192 #define NB_R_MAX     8192<\/code><\/pre>\n<p>\u0414\u0430\u043d\u043d\u044b\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u00a0<strong>nb<\/strong>\u00a0\u0434\u043b\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0441 \u0432\u0435\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c\u0438 \u0447\u0438\u0441\u043b\u0430\u043c\u0438.<\/p>\n<p>\u0412\u0435\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0447\u0438\u0441\u043b\u0430 \u0438\u043c\u0435\u044e\u0442 \u0432 \u0441\u0432\u043e\u0435\u043c \u0441\u043e\u0441\u0442\u0430\u0432\u0435 \u0434\u0432\u0430 \u043f\u043e\u043b\u044f: \u0441\u043c\u0435\u0449\u0435\u043d\u043d\u043e\u0439 \u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0438 \u043c\u0430\u043d\u0442\u0438\u0441\u0441\u044b. \u0411\u0438\u0442 \u0446\u0435\u043b\u043e\u0439 \u0435\u0434\u0438\u043d\u0438\u0446\u044b \u043d\u0435\u044f\u0432\u043d\u044b\u0439. \u0417\u043d\u0430\u043a \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d \u0432 \u0441\u0442\u0430\u0440\u0448\u0435\u043c \u0431\u0438\u0442\u0435 \u0447\u0438\u0441\u043b\u0430.<\/p>\n<p>\u041d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0445\u0435\u043c\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043e \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0432\u0435\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u043c\u0430\u0448\u0438\u043d\u044b:<\/p>\n<pre><code class=\"cpp\">if( MPU_BYTE_ORDER_BIG_ENDIAN == 0 ) {       [NB-1], . . . , [nS] | [nS-1],        . . . ,              [0];       +------ . . . -------+--------------- . . . ------------------+       | Sign  + Exponent   |              Significand               |       +------ . . . -------+--------------- . . . ------------------+        ^Sign bit           ^(1. - implicit)   size:                  nE                                       nS. }  if( MPU_BYTE_ORDER_BIG_ENDIAN == 1 ) {       [0],  . . . , [nE-1] \u2502 [nE],          . . . ,           [NB-1];       +------ . . . -------+--------------- . . . ------------------+       | Sign  + Exponent   |              Significand               |       +------ . . . -------+--------------- . . . ------------------+        ^Sign bit           ^(1. - implicit)   size:                  nE                                       nS. }<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c, \u0441\u0438\u043c\u0432\u043e\u043b\u044b\u00a0<strong>nE<\/strong>\u00a0\u0438\u00a0<strong>nS<\/strong>\u00a0\u2013 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u044e\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0431\u0430\u0439\u0442\u043e\u0432 \u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0431\u0430\u0439\u0442\u043e\u0432 \u043c\u0430\u043d\u0442\u0438\u0441\u0441\u044b, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e.<\/p>\n<p>\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0431\u0438\u0442 \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u043c\u043e\u0435 \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u043a\u0430, \u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0438 \u043c\u0430\u043d\u0442\u0438\u0441\u0441\u044b \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code>      +-----------------------+-------------------+-------------+       |  \u041e\u0431\u0449\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0431\u0438\u0442 | (Sign + Exponent) | Significand |       +-----------------------+-------------------+-------------+       |                32     |  1  +       8   + |       23    |       |                64     |  1  +      11   + |       52    |       |               128     |  1  +      31   + |       96    |       |               256     |  1  +      31   + |      224    |       |               512     |  1  +      63   + |      448    |       |              1024     |  1  +      63   + |      960    |       |              2048     |  1  +     127   + |     1920    |       |              4096     |  1  +     127   + |     3968    |       |              8192     |  1  +     255   + |     7936    |       |             16384     |  1  +     255   + |    16128    |       |             32768     |  1  +     511   + |    32256    |       |             65536     |  1  +     511   + |    65024    |       +-----------------------+-------------------+-------------+<\/code><\/pre>\n<p>\u0424\u043e\u0440\u043c\u0430\u0442\u044b 32- \u0438 64-\u0431\u0438\u0442\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0442 \u0441\u00a0<strong>IEEE<\/strong>\u00a0(Institute of Electrical and Electronics Engineers) \u0444\u043e\u0440\u043c\u0430\u0442\u043e\u043c.<\/p>\n<p>\u0414\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0434\u0435\u043a\u043b\u0430\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0432\u0435\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435\u00a0<strong>libmpu.h<\/strong>\u00a0\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0442\u0438\u043f\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"cpp\">    mpu_real16384_t  a, b;<\/code><\/pre>\n<h4>\u0411\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0441\u0442\u0438, \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0441\u0442\u044c, \u043d\u0435 \u0447\u0438\u0441\u043b\u0430, \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0435 \u0438 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0435 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u044b<\/h4>\n<p>\u0414\u043b\u044f \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u0447\u0438\u0441\u0435\u043b \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0442\u043e\u0447\u043a\u043e\u0439 \u043d\u0430\u0440\u044f\u0434\u0443 \u0441 \u043e\u0431\u044b\u0447\u043d\u044b\u043c\u0438 \u0432\u0435\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c\u0438 \u0447\u0438\u0441\u043b\u0430\u043c\u0438 \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439. \u041e\u043d\u0438 \u0438\u043c\u0435\u044e\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u0441\u043c\u044b\u0441\u043b \u0438 \u0434\u0430\u044e\u0442 \u0432\u0430\u0436\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e\u0431 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430\u0445 \u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f\u0445, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u043e\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u044d\u0442\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u041a \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c \u043e\u0442\u043d\u043e\u0441\u044f\u0442\u0441\u044f \u0432\u0435\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0447\u0438\u0441\u043b\u0430 \u0441 \u043d\u0430\u0440\u0443\u0448\u0435\u043d\u0438\u0435\u043c \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0441\u0442\u044c, \u043d\u0443\u043b\u0438, \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0441\u0442\u0438 \u0438 \u043d\u0435 \u0447\u0438\u0441\u043b\u0430, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u0435.<\/p>\n<pre><code>      +------+-------------------+-------------------+------------------+       | Sign |      Exponent     |    Significand    |   comments       |       +------+-------------------+-------------------+------------------+       |   S  |  1111 . . . 1111  |  0000 . . . 0000  |   +\/- inf        |       |   S  |  0000 . . . 0000  |  0000 . . . 0000  |   +\/- 0          |       |   1  |  1111 . . . 1111  |  1000 . . . 0000  |     - ind        |       |   S  |  1111 . . . 1111  |  0000 . . . 0001  |   +\/- NaN (min)  |       |   S  |  1111 . . . 1111  |  1111 . . . 1111  |   +\/- NaN (max)  |       +------+-------------------+-------------------+------------------+        \u0417\u0434\u0435\u0441\u044c:         +\/- inf         \u2013  +\/- \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0441\u0442\u044c;         +\/- 0           \u2013  +\/- \u0437\u043d\u0430\u043a\u043e\u0432\u044b\u0439 \u043d\u0443\u043b\u044c;           - ind         \u2013      \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0441\u0442\u044c;         +\/- NaN (min)   \u2013  +\/- \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043d\u0435 \u0447\u0438\u0441\u043b\u043e;         +\/- NaN (max)   \u2013  +\/- \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043d\u0435 \u0447\u0438\u0441\u043b\u043e.<\/code><\/pre>\n<p>\u0427\u0438\u0441\u043b\u0430 \u0441 \u043d\u0430\u0440\u0443\u0448\u0435\u043d\u0438\u0435\u043c \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438:<\/p>\n<pre><code>      +------+-------------------+-------------------+------------------+       | Sign |      Exponent     |    Significand    |   comments       |       +------+-------------------+-------------------+------------------+       |   S  |  0000 . . . 0000  |  0000 . . . 0001  |   +\/- min        |       |   S  |  0000 . . . 0000  |  1111 . . . 1111  |   +\/- max        |       +------+-------------------+-------------------+------------------+<\/code><\/pre>\n<p>\u041a\u043e\u0434\u0438\u0440\u043e\u0432\u043a\u0430 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0438 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0435\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b:<\/p>\n<pre><code>      +------+-------------------+-------------------+------------------+       | Sign |      Exponent     |    Significand    |   comments       |       +------+-------------------+-------------------+------------------+       |   S  |  0000 . . . 0001  |  0000 . . . 0000  |   +\/- MIN        |       |   S  |  1111 . . . 1110  |  1111 . . . 1111  |   +\/- MAX        |       +------+-------------------+-------------------+------------------+<\/code><\/pre>\n<h4>\u041a\u043e\u043c\u043f\u043b\u0435\u043a\u0441\u043d\u044b\u0435 \u0447\u0438\u0441\u043b\u0430<\/h4>\n<p>\u041a\u043e\u043c\u043f\u043b\u0435\u043a\u0441\u043d\u044b\u0435 \u0447\u0438\u0441\u043b\u0430 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u043c\u0430\u0448\u0438\u043d\u044b \u043a\u0430\u043a \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430, \u0441\u043e\u0441\u0442\u043e\u044f\u0449\u0430\u044f \u0438\u0437 \u0434\u0432\u0443\u0445 \u0432\u0435\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b.<\/p>\n<p>\u041a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0449\u0438\u0435 \u0440\u0430\u0437\u043c\u0435\u0440 \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0441\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b \u0432 \u0431\u0430\u0439\u0442\u0430\u0445, \u0437\u0430\u0434\u0430\u043d\u044b \u0442\u0430\u043a, \u0447\u0442\u043e \u043e\u043d\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u0443 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0441\u043d\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430:<\/p>\n<pre><code class=\"cpp\">#define NB_C32          4 #define NB_C64          8 #define NB_C128        16 #define NB_C256        32 #define NB_C512        64 #define NB_C1024      128 #define NB_C2048      256 #define NB_C4096      512 #define NB_C8192     1024 #define NB_C16384    <\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\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-444193","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/444193","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=444193"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/444193\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=444193"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=444193"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=444193"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}