{"id":402534,"date":"2024-06-29T16:34:32","date_gmt":"2024-06-29T16:34:32","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=402534"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=402534","title":{"rendered":"<span>\u0424\u0430\u043d\u0442\u043e\u043c\u043d\u044b\u0439 double \u0432 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0430\u0445 \u0434\u043b\u044f \u044f\u0434\u0435\u0440 Cortex-M*<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/21e\/d28\/36d\/21ed2836d614aeccde636a5c80f26de6.png\" width=\"564\" height=\"321\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/21e\/d28\/36d\/21ed2836d614aeccde636a5c80f26de6.png\"\/><\/figure>\n<p>\u0412 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u044f\u0432\u0438\u043b\u043e\u0441\u044c \u043c\u043d\u043e\u0433\u043e \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432 \u043d\u0430 \u044f\u0434\u0440\u0430\u0445 ARM Cortex-M*, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 \u0430\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0438 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0437\u0430\u043f\u044f\u0442\u043e\u0439 (FPU). \u0412 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c FPU \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0441 \u043e\u0434\u0438\u043d\u043e\u0447\u043d\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e (<strong>float<\/strong>) \u0438 \u0435\u0451 \u0432\u043f\u043e\u043b\u043d\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0441\u0438\u0433\u043d\u0430\u043b\u0430\u043c\u0438, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u043c\u0438 \u0441 \u0410\u0426\u041f. FPU \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0437\u0430\u0431\u044b\u0442\u044c \u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u0445 \u0434\u0438\u0441\u043a\u0440\u0435\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u0445 \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0446\u0435\u043b\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0445 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439. FPU \u0431\u044b\u0441\u0442\u0440 &#8212; \u0432\u0441\u0435 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0441 \u043e\u0434\u0438\u043d\u043e\u0447\u043d\u044b\u043c\u0438 <code>float<\/code>, \u043a\u0440\u043e\u043c\u0435 \u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0438 \u0432\u0437\u044f\u0442\u0438\u044f \u043a\u043e\u0440\u043d\u044f, \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0442 \u043d\u0430 Cortex-M4F <a href=\"https:\/\/developer.arm.com\/documentation\/ddi0439\/b\/Floating-Point-Unit\/FPU-Functional-Description\/FPU-instruction-set\" rel=\"noopener noreferrer nofollow\">\u043e\u0434\u0438\u043d \u0442\u0430\u043a\u0442<\/a>. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u043d\u0430 Cortex-M4F \u043c\u044b \u0432\u0437\u0434\u043e\u0445\u043d\u0443\u043b\u0438 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e \u0438 \u0441\u0442\u0430\u043b\u0438 \u043f\u0438\u0441\u0430\u0442\u044c \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0443 \u043d\u0430 <code>float<\/code>. \u041a\u0430\u043a \u0436\u0435 \u043c\u044b \u0443\u0434\u0438\u0432\u0438\u043b\u0438\u0441\u044c, \u043d\u0430\u0439\u0434\u044f \u0432 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u043a\u043e\u0434\u0435 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043d\u0430\u0434 <code>double<\/code> \u0441 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0439, <a href=\"https:\/\/habr.com\/ru\/post\/591925\/\" rel=\"noopener noreferrer nofollow\">\u043e\u0447\u0435\u043d\u044c \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e\u0439 \u044d\u043c\u0443\u043b\u044f\u0446\u0438\u0435\u0439<\/a>.<\/p>\n<p>\u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u043a\u0430\u043a <strong>\u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442\u044c<\/strong> \u0438 <strong>\u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c<\/strong> \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 double \u0432 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0430\u0445, \u0433\u0434\u0435 \u044f\u0434\u0440\u043e \u0430\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0442\u0438\u043f <code>float<\/code>, \u043d\u043e \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 <code>double<\/code>. <\/p>\n<p>\u0420\u0430\u0431\u043e\u0442\u0430 \u0432\u0435\u0434\u0451\u0442\u0441\u044f \u0432 \u0441\u0440\u0435\u0434\u0435 IAR Embedded Workbench \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 \u0421\u0438.<\/p>\n<h3>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 double \u0447\u0438\u0441\u0435\u043b \u0432 ARM Cortex-M*<\/h3>\n<p>\u0410 \u0432\u0435\u043b\u0438\u043a\u0430 \u043b\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430, \u0447\u0442\u043e \u0447\u0430\u0441\u0442\u044c \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043b\u0430\u0441\u044c \u0441 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0439 \u044d\u043c\u0443\u043b\u044f\u0446\u0438\u0435\u0439 <code>double<\/code>, \u0432\u043c\u0435\u0441\u0442\u043e \u0430\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u0445 <code>float<\/code>? \u0412\u043e\u0442 <a href=\"https:\/\/habr.com\/ru\/post\/591925\/\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a> \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e <code>double<\/code> \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435 \u0432 <strong>27 \u0440\u0430\u0437<\/strong>, \u0430 <a href=\"http:\/\/www.ganssle.com\/tem\/tem369.html#article2\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a> \u0447\u0438\u0441\u043b\u0430 \u043f\u043e\u043c\u0435\u043d\u044c\u0448\u0435 (\u044f \u043d\u0430\u0441\u0447\u0438\u0442\u0430\u043b \u0440\u0430\u0437\u043d\u0438\u0446\u0443 \u0432 <strong>7-15 \u0440\u0430\u0437<\/strong>). \u0421\u043e\u0433\u043b\u0430\u0441\u0438\u0442\u0435\u0441\u044c, \u0447\u0442\u043e \u0442\u0435\u0440\u044f\u0442\u044c \u0432 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u043d\u0430 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0438\u0437-\u0437\u0430 \u043e\u0448\u0438\u0431\u043e\u0447\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f <code>double<\/code>, \u0433\u0434\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e <code>float<\/code>, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0433\u0440\u0443\u0441\u0442\u043d\u043e. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0444\u0430\u043d\u0442\u043e\u043c\u043d\u044b\u0445 <code>double<\/code> \u0438\u043d\u043e\u0433\u0434\u0430 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f <a href=\"https:\/\/dzone.com\/articles\/be-aware-floating-point-operations-on-arm-cortex-m\" rel=\"noopener noreferrer nofollow\">\u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c FPU<\/a>:<\/p>\n<blockquote>\n<p>My mantra is <em>not<\/em> to use any floating point data types in embedded applications,<br \/> or at least to avoid them whenever possible: for most applications they are not<br \/> necessary and can be replaced by fixed point operations. Not only floating point<br \/> operations have numerical problems, but they can also lead to performance problems&#8230;<\/p>\n<\/blockquote>\n<p>\u041d\u0443 \u0430 \u043c\u044b \u0431\u043e\u044f\u0442\u044c\u0441\u044f <em>performance problems<\/em> \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u0438 \u043d\u0430\u0443\u0447\u0438\u043c\u0441\u044f \u0444\u0430\u043d\u0442\u043e\u043c\u043d\u044b\u0445 <code>double<\/code> \u0438\u0437\u0431\u0435\u0433\u0430\u0442\u044c.<\/p>\n<p>\u041d\u0430\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b \u044f\u0434\u0440\u0430 Cortex-M, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 FPU \u0434\u043b\u044f single precision \u0435\u0441\u0442\u044c, \u0430 \u0434\u043b\u044f double precision &#8212; \u043d\u0435\u0442. \u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0430 <a href=\"https:\/\/www.arm.com\/products\/silicon-ip-cpu?families=cortex-m&amp;showall=true\" rel=\"noopener noreferrer nofollow\">\u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u044f\u0434\u0435\u0440 Cortex-M<\/a>. \u041d\u0430\u043b\u0438\u0447\u0438\u0435 FPU \u0443 \u043f\u043e\u043c\u0435\u0447\u0435\u043d\u043d\u044b\u0445 \u2705 \u044f\u0434\u0435\u0440 \u043e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e. \u042f\u0434\u0440\u0430, \u0438\u043c\u0435\u044e\u0449\u0438\u0435 \u044d\u0442\u043e\u0442 \u0431\u043b\u043e\u043a, \u0447\u0430\u0441\u0442\u043e <a href=\"https:\/\/www.electronicshub.org\/arm-introduction\/\" rel=\"noopener noreferrer nofollow\">\u043f\u043e\u043c\u0435\u0447\u0430\u044e\u0442\u0441\u044f \u0441\u0443\u0444\u0444\u0438\u043a\u0441\u043e\u043c<\/a> F: \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, Cortex-M4F.<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"center\">\u0412\u0435\u0440\u0441\u0438\u044f \u044f\u0434\u0440\u0430<\/p>\n<\/th>\n<th>\n<p align=\"center\">FPU (half precision)<\/p>\n<\/th>\n<th>\n<p align=\"center\">FPU (single precision)<\/p>\n<\/th>\n<th>\n<p align=\"center\">FPU (double precision)<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\">Cortex-M0<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u274c<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u274c<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u274c<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\">Cortex-M0+<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u274c<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u274c<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u274c<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\">Cortex-M1<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u274c<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u274c<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u274c<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\">Cortex-M3<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u274c<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u274c<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u274c<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\">Cortex-M4<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u274c<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u2705 (Optional)<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u274c<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\">Cortex-M7<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u274c<\/p>\n<\/td>\n<td colspan=\"2\">\n<p align=\"center\">\u2705 (Optional)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\">Cortex-M23<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u274c<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u274c<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u274c<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\">Cortex-M33<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u274c<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u2705 (Optional)<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u274c<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\">Cortex-M35P<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u274c<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u2705 (Optional)<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u274c<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\">Cortex-M55<\/p>\n<\/td>\n<td colspan=\"3\">\n<p align=\"center\">\u2705 (Optional)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\">Cortex-M85<\/p>\n<\/td>\n<td colspan=\"3\">\n<p align=\"center\">\u2705 (Optional)<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h3>\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u0430\u044f \u044d\u043c\u0443\u043b\u044f\u0446\u0438\u044f<\/h3>\n<p>\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442 \u0421\u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0447\u0438\u0441\u0435\u043b \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0442\u043e\u0447\u043a\u043e\u0439, \u043a\u0430\u043a <code>float<\/code>, \u0442\u0430\u043a \u0438 <code>double<\/code>. \u041a\u0430\u043a \u0436\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043a\u043e\u0434 \u0434\u043b\u044f \u044f\u0434\u0435\u0440 \u0431\u0435\u0437 \u0430\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u043e\u0439 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0434\u0440\u043e\u0431\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432? \u041a\u0430\u0436\u0434\u0430\u044f \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u0432\u044b\u0437\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <em>\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0439 \u044d\u043c\u0443\u043b\u044f\u0446\u0438\u0438<\/em>. \u0423 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 \u0441\u0432\u043e\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u043e\u0432. <strong>\u0412\u0441\u044f\u043a\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u0434\u0440\u043e\u0431\u043d\u044b\u043c\u0438 \u0442\u0438\u043f\u0430\u043c\u0438 \u043d\u0430 \u044f\u0434\u0440\u0430\u0445 \u0431\u0435\u0437 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e FPU \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u0442 \u043a \u0432\u044b\u0437\u043e\u0432\u0443 \u044d\u043c\u0443\u043b\u0438\u0440\u0443\u044e\u0449\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439!<\/strong> \u0411\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e, \u0435\u0441\u043b\u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043d\u0435 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043e\u043f\u0446\u0438\u044e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 FPU \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430, \u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u0430\u044f \u044d\u043c\u0443\u043b\u044f\u0446\u0438\u044f \u0434\u043b\u044f \u0447\u0438\u0441\u0435\u043b \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0437\u0430\u043f\u044f\u0442\u043e\u0439, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u043c\u043e\u0433\u043b\u0438 \u0431\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u0430\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u043e.<\/p>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043b\u0443\u0447\u0430\u0439 \u044d\u043c\u0443\u043b\u044f\u0446\u0438\u0438 \u0447\u0438\u0441\u0435\u043b \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0437\u0430\u043f\u044f\u0442\u043e\u0439.<\/p>\n<pre><code class=\"cpp\">\/\/ Example for no-FPU device const int N = 1000; int half_of_N;  \/\/ 1) Inefficient way half_of_N = 0.5 * N;  \/\/ C standard treats 0.5 as double literal  \/\/ 2) Optimized way half_of_N = N \/ 2;<\/code><\/pre>\n<p>\u0423\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u0446\u0435\u043b\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u043d\u0430 <code>0.5<\/code> \u043f\u0440\u043e\u0439\u0434\u0435\u0442 \u0432 \u0447\u0435\u0442\u044b\u0440\u0435 \u044d\u0442\u0430\u043f\u0430:<\/p>\n<ol>\n<li>\n<p>\u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u044f N \u0432 <code>double<\/code> \u0442\u0438\u043f, \u0432\u044b\u0437\u043e\u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>..._i2d()<\/code><\/p>\n<\/li>\n<li>\n<p>\u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 <code>double<\/code> \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b <code>0.5<\/code> \u043d\u0430 \u0441\u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0432 <code>double<\/code> N, \u0442.\u0435. \u0432\u044b\u0437\u043e\u0432 \u044d\u043c\u0443\u043b\u0438\u0440\u0443\u044e\u0449\u0435\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 &#8212; <code>..._dmul()<\/code><\/p>\n<\/li>\n<li>\n<p>\u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0432 <code>int<\/code> &#8212; \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>..._d2i()<\/code><\/p>\n<\/li>\n<li>\n<p>\u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u0432 half_of_N.<\/p>\n<\/li>\n<\/ol>\n<p>\u041f\u0440\u043e\u0441\u0442\u043e\u0435 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u0434\u0440\u043e\u0431\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u043d\u0430 \u044f\u0434\u0440\u0435 \u0431\u0435\u0437 FPU \u043f\u0440\u0438\u0432\u0435\u043b\u043e \u043a \u0432\u044b\u0437\u043e\u0432\u0443 \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u0442\u0440\u0451\u0445 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439. \u0411\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e, \u0432 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0443 \u0431\u044b\u043b\u0438 \u043f\u0440\u0438\u043b\u0438\u043d\u043a\u043e\u0432\u0430\u043d\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u044d\u0442\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0447\u0442\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u0435\u0451 \u0440\u0430\u0437\u043c\u0435\u0440 \u0433\u0440\u0443\u0431\u043e \u043d\u0430 <a href=\"http:\/\/www.ganssle.com\/tem\/tem369.html#article2\" rel=\"noopener noreferrer nofollow\">1 \u043a\u0411<\/a>. \u0427\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0430 \u043d\u0435 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u043b\u0430\u0441\u044c \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 <strong>\u0432\u0441\u0435<\/strong> \u043c\u0435\u0441\u0442\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0439 \u044d\u043c\u0443\u043b\u044f\u0446\u0438\u0438 \u0438 \u0443\u0431\u0440\u0430\u0442\u044c \u0438\u0445.<\/p>\n<h3>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u044f double \u044d\u043c\u0443\u043b\u044f\u0446\u0438\u0438<\/h3>\n<p>\u0418\u0442\u0430\u043a, \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u043d\u0435\u0442 \u043b\u0438 \u0432 \u043d\u0430\u0448\u0435\u0439 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0435 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f double. \u0418\u043d\u043e\u0433\u0434\u0430 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0443 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u0441\u0430\u043c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 (<a href=\"https:\/\/community.arm.com\/arm-community-blogs\/b\/architectures-and-processors-blog\/posts\/10-useful-tips-to-using-the-floating-point-unit-on-the-arm-cortex--m4-processor\" rel=\"noopener noreferrer nofollow\">c\u0441\u044b\u043b\u043a\u0430<\/a>, \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438). \u0422\u0430\u043a, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, gcc \u0438\u043c\u0435\u0435\u0442 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0444\u043b\u0430\u0433 <code>-Wdouble-promotion<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u043e\u043f\u043e\u0432\u0435\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430 \u043e \u043d\u0435\u044f\u0432\u043d\u043e\u0439 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u0438 <code>float<\/code> \u0432 <code>double<\/code>. \u0422\u0430\u043a\u0436\u0435 \u0434\u0440\u043e\u0431\u043d\u044b\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u043a\u0430\u043a <code>float<\/code>, \u0435\u0441\u043b\u0438 gcc \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0444\u043b\u0430\u0433 <code>-fsingle-precision-constant<\/code>. \u0412 <strong>IAR Embedded Workbench<\/strong> \u043d\u0435\u0442 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0433\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b. \u041f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c\u0441\u044f \u0440\u0435\u0432\u0435\u0440\u0441\u043e\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0438 \u0441 \u043a\u043e\u043d\u0446\u0430.<\/p>\n<ol>\n<li>\n<p>\u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u043f\u0440\u043e\u0435\u043a\u0442 \u0438 \u043f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u0432 \u0435\u0433\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043f\u043e\u0434\u043f\u0443\u043d\u043a\u0442 <code>Linker->List<\/code> \u0438 \u043f\u043e\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u0433\u0430\u043b\u043e\u0447\u043a\u0443 \u0432 \u0447\u0435\u043a\u0431\u043e\u043a\u0441 <code>Generate linker map file<\/code>.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/bz\/o2\/ab\/bzo2abr3-9wt-qgxjesdwlo0nrc.png\" alt=\"\u041e\u043a\u043d\u043e \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0432\u044b\u0432\u043e\u0434\u0430 map \u0444\u0430\u0439\u043b\u0430 \u043b\u0438\u043d\u043a\u043e\u0432\u0449\u0438\u043a\u0430 IAR EWARM\" title=\"\u041e\u043a\u043d\u043e \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0432\u044b\u0432\u043e\u0434\u0430 map \u0444\u0430\u0439\u043b\u0430 \u043b\u0438\u043d\u043a\u043e\u0432\u0449\u0438\u043a\u0430 IAR EWARM\" width=\"537\" height=\"482\" data-src=\"https:\/\/habrastorage.org\/webt\/bz\/o2\/ab\/bzo2abr3-9wt-qgxjesdwlo0nrc.png\"\/><\/p>\n<div><figcaption>\u041e\u043a\u043d\u043e \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0432\u044b\u0432\u043e\u0434\u0430 map \u0444\u0430\u0439\u043b\u0430 \u043b\u0438\u043d\u043a\u043e\u0432\u0449\u0438\u043a\u0430 IAR EWARM<\/figcaption><\/div>\n<\/figure>\n<\/li>\n<li>\n<p>\u0421\u043e\u0431\u0435\u0440\u0438\u0442\u0435 \u043f\u0440\u043e\u0435\u043a\u0442. \u0412 \u043f\u0430\u043f\u043a\u0435 output \u0432 \u0434\u0435\u0440\u0435\u0432\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f *.map \u0444\u0430\u0439\u043b.<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/mt\/hz\/ug\/mthzuguu77twzopphfh4-qyz7u8.png\" alt=\"\u0414\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0432 \u043f\u0430\u043f\u043a\u0435 Output \u0444\u0430\u0439\u043b\u0430 *.map\" title=\"\u0414\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0432 \u043f\u0430\u043f\u043a\u0435 Output \u0444\u0430\u0439\u043b\u0430 *.map\" width=\"376\" height=\"233\" data-src=\"https:\/\/habrastorage.org\/webt\/mt\/hz\/ug\/mthzuguu77twzopphfh4-qyz7u8.png\"\/><\/p>\n<div><figcaption>\u0414\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0432 \u043f\u0430\u043f\u043a\u0435 Output \u0444\u0430\u0439\u043b\u0430 *.map<\/figcaption><\/div>\n<\/figure>\n<\/li>\n<li>\n<p>\u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u0435\u0433\u043e \u0438 \u043e\u0442\u043b\u0438\u0441\u0442\u0430\u0439\u0442\u0435 \u0434\u043e \u0441\u0435\u043a\u0446\u0438\u0438 &#171;ENTRY LIST&#187;. \u0412 \u043d\u0435\u0439 \u0432\u044b \u043d\u0430\u0439\u0434\u0451\u0442\u0435 \u0438\u043c\u0435\u043d\u0430 \u0432\u0441\u0435\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0432 \u043a\u043e\u0434\u0435. \u0412 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0438 \u0432\u0441\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 <code>..._f2d()<\/code>,<code>..._dmul()<\/code> \u0438 \u043f\u0440\u043e\u0447\u0438\u0435.<\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u043f\u043e\u0438\u0441\u043a \u043f\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u0438 <code>f2d<\/code>, <code>ui2d<\/code> \u0438 <code>l2d<\/code>. \u0412 \u043c\u043e\u0451\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044f \u043d\u0430\u0448\u0451\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/pc\/a1\/ln\/pca1ln8f-pmqjthzithkehmoe38.png\" alt=\"\u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 *.map \u0444\u0430\u0439\u043b\u0430 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0439 \u044d\u043c\u0443\u043b\u044f\u0446\u0438\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u043d\u0430\u0434 double\" title=\"\u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 *.map \u0444\u0430\u0439\u043b\u0430 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0439 \u044d\u043c\u0443\u043b\u044f\u0446\u0438\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u043d\u0430\u0434 double\" width=\"635\" height=\"319\" data-src=\"https:\/\/habrastorage.org\/webt\/pc\/a1\/ln\/pca1ln8f-pmqjthzithkehmoe38.png\"\/><\/p>\n<div><figcaption>\u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 *.map \u0444\u0430\u0439\u043b\u0430 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0439 \u044d\u043c\u0443\u043b\u044f\u0446\u0438\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u043d\u0430\u0434 double<\/figcaption><\/div>\n<\/figure>\n<\/li>\n<\/ol>\n<p>\u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u0444\u0430\u043d\u0442\u043e\u043c\u043d\u044b\u0439 <code>double<\/code> \u0432 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0435 \u0435\u0441\u0442\u044c. \u041d\u0430 \u0441\u043a\u0438\u043d\u0448\u043e\u0442\u0435 \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0435\u0449\u0435 \u043c\u043d\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u0438 \u0442\u0438\u043f\u043e\u0432 \u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0439 \u044d\u043c\u0443\u043b\u044f\u0446\u0438\u0438 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0437\u0430\u043f\u044f\u0442\u043e\u0439. \u0412 \u043c\u043e\u043c\u0435\u043d\u0442 \u0438\u0437\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043e\u0442 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0442\u0438\u043f\u0430 <code>double<\/code> \u043e\u043d\u0438 \u0440\u0430\u0437\u043e\u043c \u0438\u0441\u0447\u0435\u0437\u043d\u0443\u0442.<\/p>\n<h3>\u041f\u043e\u0438\u0441\u043a double \u0432 \u043a\u043e\u0434\u0435.<\/h3>\n<p>\u041d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u044e, \u0447\u0442\u043e \u043c\u044b \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043a\u043e\u0434 \u0434\u043b\u044f \u044f\u0434\u0440\u0430 \u0441 FPU, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e <code>float<\/code>. Cortex-M4F, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440.<\/p>\n<h4>\u041f\u0435\u0440\u0432\u0430\u044f \u0441\u0442\u0443\u043f\u0435\u043d\u044c &#8212; \u043f\u043e\u0438\u0441\u043a \u043f\u043e \u0442\u0435\u043a\u0441\u0442\u0443 \u043a\u043e\u0434\u0430<\/h4>\n<p>\u041f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u043c \u043d\u0435\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a \u043f\u043e \u0432\u0441\u0435\u043c \u0444\u0430\u0439\u043b\u0430\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0430 (Ctrl+Shift+F) \u0441\u043b\u043e\u0432\u0430 <code>double<\/code>. \u041e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u0433\u0434\u0435-\u0442\u043e \u0440\u0443\u043a\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430 \u0434\u0440\u043e\u0433\u043d\u0443\u043b\u0430 \u0438 \u043e\u043d \u0435\u0433\u043e \u0432\u0441\u0451-\u0442\u0430\u043a\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043b.<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/ki\/up\/dr\/kiupdrb41yidwjf397z_hkpalws.png\" alt=\"\u0412\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u0432 IAR EWARM \u043f\u043e\u0438\u0441\u043a \u043f\u043e \u0444\u0430\u0439\u043b\u0430\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441\u043b\u043e\u0432\u0430 double\" title=\"\u0412\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u0432 IAR EWARM \u043f\u043e\u0438\u0441\u043a \u043f\u043e \u0444\u0430\u0439\u043b\u0430\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441\u043b\u043e\u0432\u0430 double\" width=\"487\" height=\"404\" data-src=\"https:\/\/habrastorage.org\/webt\/ki\/up\/dr\/kiupdrb41yidwjf397z_hkpalws.png\"\/><\/p>\n<div><figcaption>\u0412\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u0432 IAR EWARM \u043f\u043e\u0438\u0441\u043a \u043f\u043e \u0444\u0430\u0439\u043b\u0430\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441\u043b\u043e\u0432\u0430 double<\/figcaption><\/div>\n<\/figure>\n<p>\u0410 \u0432\u043e\u0442 \u0442\u0443\u0442 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0438\u0441\u043a\u0430\u0442\u044c \u0447\u0430\u0441\u0442\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443:<\/p>\n<pre><code class=\"cpp\">\/\/ ST5918L3008 parameters are used as default values. const static StepperParameters_t StepperParametersDefault = {   .L = 0.0076 * 0.1f, \/\/ H -> 0.1H   .R = 2.2 * 0.1f, \/\/ Ohm -> 0.1Ohm   .Fm = 0.009 * 100.0f, \/\/ Wb -> cWb };  static void StepperFOCSensorless_PIDReconfigureCallback(void) {   \/*    * Update PID if SPID was changed    * 1. Kp, Ki, Kd units in firmware: mA\/rad, mA\/(rad*T) and mA*T\/rad, where T is period.    * 2. Kp, Ki, Kd  units in GUI: A\/rad, A\/(rad*s), A*s\/rad but XiLab multiplies them on 0.001 before sending.    * 4. Parameters can be changed during movement.    *\/   \/\/ assign new values   PositionRegulator_param.Kp =  1e6 * BCDFlashParams.SPID.Kpf; \/\/ rad -> mA   PositionRegulator_param.Kd =  1e6 * BCDFlashParams.SPID.Kdf * STEPPER_FOC_PWM_FREQ ; \/\/ rad\/T -> mA   PositionRegulator_param.Ki =  1e6 * BCDFlashParams.SPID.Kif * STEPPER_FOC_PWM_PERIOD_FLOAT; \/\/ rad T -> mA }<\/code><\/pre>\n<p>\u042f\u0437\u044b\u043a C \u043a\u043e\u0432\u0430\u0440\u0435\u043d \u0442\u0435\u043c, \u0447\u0442\u043e \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432\u0441\u0435 \u0434\u0440\u043e\u0431\u043d\u044b\u0435 \u0447\u0438\u0441\u043b\u0430 \u0442\u0440\u0430\u043a\u0442\u0443\u0435\u0442 \u043a\u0430\u043a <code>double<\/code>. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code>0.0076<\/code> &#8212; \u044d\u0442\u043e <code>double<\/code>. \u0415\u0441\u043b\u0438 \u043c\u044b \u0443\u043c\u043d\u043e\u0436\u0430\u0435\u043c \u0435\u0433\u043e \u043d\u0430 <code>0.1f<\/code>, \u0442\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u0442\u0438\u043f \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f, \u043a\u0430\u043a \u0431\u043e\u043b\u0435\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u044b\u0439 \u0438\u0437 \u0434\u0432\u0443\u0445, \u0442\u043e \u0435\u0441\u0442\u044c <code>double<\/code>. \u0415\u0449\u0451 \u0431\u043e\u043b\u044c\u0448\u0435\u0435 \u043a\u043e\u0432\u0430\u0440\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0444\u043e\u0440\u043c\u043e\u0439: \u0447\u0438\u0441\u043b\u043e <code>1e6<\/code> \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0446\u0435\u043b\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u043c, \u0435\u0433\u043e \u0442\u0438\u043f \u0442\u043e\u0436\u0435 <code>double<\/code>. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0441\u0443\u0444\u0444\u0438\u043a\u0441 <code>f<\/code>\/<code>F<\/code> \u043d\u0430 \u043a\u043e\u043d\u0446\u0435 \u0447\u0438\u0441\u043b\u043e\u0432\u044b\u0445 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442, \u0447\u0442\u043e\u0431\u044b \u044f\u0432\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0442\u0438\u043f <code>float<\/code>. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <code>1e6f<\/code>.<\/p>\n<p>\u041a\u0430\u043a \u043d\u0430\u0439\u0442\u0438 \u0432 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0435 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b? \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043f\u043e\u0438\u0441\u043a \u043f\u043e \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u043c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0441\u0442\u0440\u043e\u0435\u043d \u0432 IAR Embedded Workbench. \u0412\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 <code>[^\\.\\d\\w#][0-9]+[\\.eE][0-9]*[^\\.\\w0-9]<\/code>.<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/8t\/px\/sx\/8tpxsxczzkjugfzg74rpe5jjz9u.png\" alt=\"\u0412\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u0432 IAR EWARM \u043f\u043e\u0438\u0441\u043a \u043f\u043e \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u043c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u043c \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 float \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\" title=\"\u0412\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u0432 IAR EWARM \u043f\u043e\u0438\u0441\u043a \u043f\u043e \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u043c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u043c \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 float \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\" width=\"489\" height=\"406\" data-src=\"https:\/\/habrastorage.org\/webt\/8t\/px\/sx\/8tpxsxczzkjugfzg74rpe5jjz9u.png\"\/><\/p>\n<div><figcaption>\u0412\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u0432 IAR EWARM \u043f\u043e\u0438\u0441\u043a \u043f\u043e \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u043c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u043c \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 float \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442<\/figcaption><\/div>\n<\/figure>\n<p>\u0420\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0438\u0449\u0435\u0442 \u043d\u0435 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0435\u0441\u044f \u0441 \u0431\u0443\u043a\u0432, \u0442\u043e\u0447\u0435\u043a \u0438 # \u0446\u0438\u0444\u0440\u044b, \u0433\u0434\u0435 \u0435\u0441\u0442\u044c \u0442\u043e\u0447\u043a\u0430 \u0438\u043b\u0438 \u0431\u0443\u043a\u0432\u0430 \u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0432 \u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0435 \u0438\u043b\u0438 \u0432 \u043a\u043e\u043d\u0446\u0435, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u043d\u0435 \u0438\u0434\u0451\u0442 \u0442\u043e\u0447\u043a\u0430, \u0431\u0443\u043a\u0432\u0430 \u0438\u043b\u0438 \u0446\u0438\u0444\u0440\u0430. \u0422\u0430\u043a\u043e\u0435 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0434\u0430\u0451\u0442 \u043c\u043d\u043e\u0433\u043e \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0439 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445 \u043a \u043a\u043e\u0434\u0443, \u0447\u0442\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u0443\u0435\u0442\u0441\u044f \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e. \u041e\u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442 \u043d\u0435 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b <code>3e-4<\/code> \u0438\u043b\u0438 <code>1e3L<\/code>, \u043d\u0435 \u0438\u043c\u0435\u044e\u0449\u0438\u043c \u0442\u0438\u043f <code>float<\/code> , \u043d\u043e \u043c\u043d\u0435 \u0445\u0432\u0430\u0442\u0438\u043b\u043e \u0438 \u0442\u0430\u043a\u043e\u0433\u043e \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0433\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043e\u0448\u0438\u0431\u043a\u0438 \u043f\u043e\u0441\u043b\u043e\u0436\u043d\u0435\u0435:<\/p>\n<pre><code class=\"cpp\">  \/*    * right half of voltage cicle is inside current circle    * NOTE: if voltage circle is inside current circle (Imax > Iu + I0) then intersection point does not exists,    * but Iu^2 - Imax^2 - I0^ &lt; -2*I0^2 -2*I0*Iu and Id &lt; -I0 - Iu &lt;= I0    *\/   if (Id_limit &lt; -I0)   {     \/\/ FW_VOLTAGE_ONLY: limit only voltage     if (fabs(Irq) &lt; Iu)     {       pIr->d = -I0 + sqrtf(Iu * Iu - Irq * Irq);       if (pIr->d > 0)       {         pIr->d = 0.0f;       }       pIr->q = Irq;       return; \/\/ nolimit     }     else     {       pIr->d = -I0;       if (Irq > 0.0f)       {         pIr->q = Iu;       }       else       {         pIr->q = -Iu;       }       return; \/\/ limit     }   }    \/*    * Main case: Id_limit is between located between -I0 and 0.    *\/    \/*    * Check if line Iq = Irq intersects the voltage circle    * then  calculate intersection Id coordinate and check if it is is not greater then Id_limit    *\/   if (fabs(Irq) >= Iu || (Id_fw = -I0 + sqrtf(Iu * Iu - Irq * Irq)) &lt; Id_limit)   {     \/*      * LIMIT_MAIN_CASE: apply maximal current in Irq direction      *\/     pIr->d = Id_limit;     pIr->q = sqrtf(Imax * Imax - Id_limit * Id_limit);     if (Irq &lt; 0)     {       pIr->q = -pIr->q;     }     return; \/\/ limit   }<\/code><\/pre>\n<p>\u0412 \u044d\u0442\u043e\u043c \u043a\u043e\u0434\u0435 \u0432\u0441\u0435 \u0434\u0440\u043e\u0431\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0438\u043c\u0435\u044e\u0442 \u0442\u0438\u043f <code>float<\/code>, \u043d\u043e <code>double<\/code> \u0432\u0441\u0451-\u0442\u0430\u043a\u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442. \u0418 \u0434\u0435\u043b\u043e \u0432 \u0432\u044b\u0437\u043e\u0432\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0439. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0434\u043e\u0433\u0430\u0434\u0430\u0442\u044c\u0441\u044f \u043e \u043a\u0430\u043a\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438\u0434\u0451\u0442 \u0440\u0435\u0447\u044c. <\/p>\n<p>\u0410 \u043f\u043e\u043a\u0430 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0442\u0435\u043e\u0440\u0438\u0438 \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u0414\u043b\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432\u0437\u044f\u0442\u0438\u044f \u043a\u043e\u0440\u043d\u044f, \u0441\u0438\u043d\u0443\u0441\u0430, \u043a\u043e\u0441\u0438\u043d\u0443\u0441\u0430, \u0438 \u0434\u0430\u0436\u0435 \u0434\u043b\u044f \u043c\u043e\u0434\u0443\u043b\u044f \u0447\u0438\u0441\u043b\u0430 \u0435\u0441\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0438\u0435 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0438\u0435 \u0442\u0438\u043f <code>double<\/code>, \u0430 \u0435\u0441\u0442\u044c \u0438\u0445 \u0431\u043e\u043b\u0435\u0435 \u0431\u044b\u0441\u0442\u0440\u044b\u0435 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u044b, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0435 \u0441 \u0442\u0438\u043f\u043e\u043c <code>float<\/code>. \u041e\u043d\u0438 \u0438\u043c\u0435\u044e\u0442 \u0441\u0443\u0444\u0444\u0438\u043a\u0441 <code>f<\/code> \u0432 \u043a\u043e\u043d\u0446\u0435.<\/p>\n<pre><code class=\"cpp\">\/\/ Double functions sin(x);    \/\/ double cos(x);    \/\/ double sqrt(x);   \/\/ double fabs(x)    \/\/ double  \/\/ Float functions sinf(x);   \/\/ float alternative cosf(x);   \/\/ float alternative sqrtf(x);  \/\/ float alternative fabsf(x);  \/\/ float alternative <\/code><\/pre>\n<p>\u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u0435\u043b\u043e \u0431\u044b\u043b\u043e \u0432 <code>fabs()<\/code>. \u041d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f, \u0438 \u043c\u043d\u0435 \u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e <code>fabs()<\/code> \u0443\u0436\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <code>float<\/code>. \u042d\u0442\u043e \u043d\u0435 \u0442\u0430\u043a. <code>fabs<\/code> \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 floating point abs, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0438\u0439 <code>double<\/code>. \u0410 <code>fabsf<\/code> &#8212; floating point abs for float, \u044d\u0442\u043e \u0443\u0436\u0435 <code>float<\/code> \u0444\u0443\u043d\u043a\u0446\u0438\u044f.<\/p>\n<p>\u041a\u0430\u043a \u043d\u0430\u0439\u0442\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0438\u0435 double \u0442\u0438\u043f? \u041c\u043e\u0433\u0443 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043e\u0432\u0435\u0442\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0439\u0442\u0438\u0441\u044c \u043f\u043e\u0438\u0441\u043a\u043e\u043c \u043f\u043e \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c: sqrt, cos, sin, fabs&#8230; \u0417\u0430\u043c\u0435\u043d\u0438\u0442\u0435 \u0438\u0445 \u043d\u0430 <code>float<\/code> \u0430\u043d\u0430\u043b\u043e\u0433\u0438: sqrtf, cosf, sinf, fabsf&#8230;<\/p>\n<p>\u041f\u0435\u0440\u0432\u0430\u044f \u0441\u0442\u0430\u0434\u0438\u044f \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0430. \u0421\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0439\u0442\u0435 \u043f\u0440\u043e\u0435\u043a\u0442 \u0438 \u043f\u0440\u043e\u0432\u0435\u0434\u0438\u0442\u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u0443\u044e \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0443. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0430 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 double. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u043a\u043e\u043f\u043d\u0443\u043b\u0438 \u0433\u043b\u0443\u0431\u0436\u0435.<\/p>\n<h4>\u0412\u0442\u043e\u0440\u0430\u044f \u0441\u0442\u0443\u043f\u0435\u043d\u044c &#8212; \u043f\u043e\u0438\u0441\u043a \u043f\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u044b\u043c \u0444\u0430\u0439\u043b\u0430\u043c<\/h4>\n<p>\u0415\u0441\u043b\u0438 \u043f\u0435\u0440\u0432\u0430\u044f \u0441\u0442\u0443\u043f\u0435\u043d\u044c \u043d\u0435 \u0438\u0437\u0431\u0430\u0432\u0438\u043b\u0430 \u0432\u0430\u0441 \u043e\u0442 <code>double<\/code>, \u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0445\u043e\u0442\u044f \u0431\u044b \u0441\u0443\u0437\u0438\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u043f\u043e\u0438\u0441\u043a\u0430. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u0441\u043f\u0438\u0441\u043e\u043a \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u0445 \u0432 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0435 \u044d\u043c\u0443\u043b\u0438\u0440\u0443\u044e\u0449\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0430 \u0437\u0430\u0442\u0435\u043c \u0441\u0434\u0435\u043b\u0430\u0439\u0442\u0435 \u043f\u043e\u0438\u0441\u043a \u0438\u043c\u0451\u043d \u044d\u0442\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u0430\u0445, <code>*.o<\/code>. \u0418\u0434\u0435\u044f \u0437\u0434\u0435\u0441\u044c \u0442\u0430\u043a\u043e\u0432\u0430: \u043b\u0438\u043d\u043a\u0435\u0440 \u043f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u0438\u043b \u0438\u0445 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442, \u0442\u0430\u043a \u043a\u0430\u043a \u0432 \u043e\u0434\u043d\u043e\u043c \u0438\u043b\u0438 \u0431\u043e\u043b\u0435\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435 \u043d\u0430 \u043d\u0438\u0445 \u0441\u0442\u043e\u0438\u0442 \u0441\u0441\u044b\u043b\u043a\u0430. \u0421\u0441\u044b\u043b\u043a\u0430 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0438\u043c\u0435\u043d\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0430 \u043c\u044b \u0435\u0433\u043e \u0437\u043d\u0430\u0435\u043c. \u0414\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 Double Commander. \u042d\u0442\u043e open source, cross platform \u043a\u043b\u043e\u043d Total Commander.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/bo\/_9\/xl\/bo_9xlb7t7qi5clgdjxqtfdfd3g.png\" alt=\"\u041f\u043e\u0438\u0441\u043a \u0432\u043d\u0443\u0442\u0440\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u0441\u0441\u044b\u043b\u043e\u043a \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u044d\u043c\u0443\u043b\u044f\u0446\u0438\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0441 double\" title=\"\u041f\u043e\u0438\u0441\u043a \u0432\u043d\u0443\u0442\u0440\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u0441\u0441\u044b\u043b\u043e\u043a \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u044d\u043c\u0443\u043b\u044f\u0446\u0438\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0441 double\" width=\"832\" height=\"699\" data-src=\"https:\/\/habrastorage.org\/webt\/bo\/_9\/xl\/bo_9xlb7t7qi5clgdjxqtfdfd3g.png\"\/><\/p>\n<div><figcaption>\u041f\u043e\u0438\u0441\u043a \u0432\u043d\u0443\u0442\u0440\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u0441\u0441\u044b\u043b\u043e\u043a \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u044d\u043c\u0443\u043b\u044f\u0446\u0438\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0441 double<\/figcaption><\/div>\n<\/figure>\n<p>\u0412 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u043d\u0430\u0439\u0434\u0451\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0438\u0437 <code>*.map<\/code> \u0444\u0430\u0439\u043b\u0430 (\u0435\u0441\u043b\u0438 \u043d\u0435\u0442, \u0442\u043e \u0432\u044b \u043b\u0438\u043d\u043a\u0443\u0435\u0442\u0435 \u0435\u0449\u0435 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0439 \u043a\u043e\u0434, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438; \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e \u0431\u044b\u043b\u043e \u043d\u0435 \u0442\u0430\u043a). \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 <code>*.c<\/code> \u0444\u0430\u0439\u043b \u044f\u0432\u043d\u043e \u0438\u043b\u0438 \u043d\u0435\u044f\u0432\u043d\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f <code>double<\/code>. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e \u0434\u0430\u043b\u044c\u0448\u0435 \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u043a\u043e\u0434 \u0441\u0442\u0440\u043e\u0447\u043a\u0430 \u0437\u0430 \u0441\u0442\u0440\u043e\u0447\u043a\u043e\u0439 \u0438 \u0438\u0441\u043a\u0430\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0433\u043b\u0430\u0437\u0430\u043c\u0438. \u0418 \u0442\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u044d\u0442\u043e \u043b\u0443\u0447\u0448\u0435, \u0447\u0435\u043c \u043d\u0438\u0447\u0435\u0433\u043e \ud83d\ude42<\/p>\n<p>\u0422\u0430\u043a \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e\u0438\u0441\u043a \u043f\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u044b\u043c \u0444\u0430\u0439\u043b\u0430\u043c \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u0430\u043b \u043c\u043d\u0435, \u0447\u0442\u043e <code>double<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u0444\u0430\u0439\u043b\u0435 <code>bldc.c<\/code>. \u0412\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u0437\u0443\u0447\u0430\u044f \u043a\u043e\u0434, \u044f \u043d\u0430\u0442\u043a\u043d\u0443\u043b\u0441\u044f \u043d\u0430 \u043d\u0435\u0437\u043d\u0430\u043a\u043e\u043c\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u0447\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>arm_inv_clarke_f32<\/code>. \u041f\u0435\u0440\u0435\u0439\u0434\u044f \u0432 \u0435\u0451 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435, \u044f \u043d\u0430\u0448\u0451\u043b \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/nr\/33\/2_\/nr332_or66ce1bkinsayry2mol8.png\" alt=\"\u041e\u0448\u0438\u0431\u043a\u0430 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 CMSIS, \u0433\u0434\u0435 \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0444\u0430\u043d\u0442\u043e\u043c\u043d\u044b\u0439 double\" title=\"\u041e\u0448\u0438\u0431\u043a\u0430 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 CMSIS, \u0433\u0434\u0435 \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0444\u0430\u043d\u0442\u043e\u043c\u043d\u044b\u0439 double\" width=\"556\" height=\"231\" data-src=\"https:\/\/habrastorage.org\/webt\/nr\/33\/2_\/nr332_or66ce1bkinsayry2mol8.png\"\/><\/p>\n<div><figcaption>\u041e\u0448\u0438\u0431\u043a\u0430 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 CMSIS, \u0433\u0434\u0435 \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0444\u0430\u043d\u0442\u043e\u043c\u043d\u044b\u0439 double<\/figcaption><\/div>\n<\/figure>\n<p>\u041e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u044d\u0442\u043e \u043e\u0448\u0438\u0431\u043a\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 <strong>\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u0447\u043d\u043e\u0439<\/strong> \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 arm_math.h \u0438\u0437 CMSIS, revision: v1.4.4. \u0422\u0443\u0442 \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u0437\u043d\u0430\u043a\u043e\u043c\u043e\u0435 \u043f\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0443 \u0432\u044b\u0448\u0435 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 <code>0.5<\/code>. \u042d\u0442\u043e <code>double<\/code> \u0442\u0438\u043f! \u041f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043f\u0430\u0442\u0447\u0438\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443.<\/p>\n<h3>\u0412\u044b\u0432\u043e\u0434\u044b<\/h3>\n<p>\u0422\u043e, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u0432 GCC \u043e\u0434\u043d\u0438\u043c-\u0434\u0432\u0443\u043c\u044f \u0444\u043b\u0430\u0433\u0430\u043c\u0438, \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u0432 IAR \u043f\u043e\u0438\u0441\u043a\u043e\u043c \u0441 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u043c\u0438 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u043c\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0438\u0441\u043a\u043e\u043c \u0432 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u0430\u0445, \u0430 \u0437\u0430\u0442\u0435\u043c \u043f\u0440\u0438\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u043c \u043f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u043d\u0438\u0435\u043c \u043a\u043e\u0434\u0430. \u0418 \u0441\u0430\u043c\u0430\u044f \u0441\u043b\u043e\u0436\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u043d\u0430\u0448\u043b\u0430\u0441\u044c \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 CMSIS. \u0422\u043e \u0435\u0441\u0442\u044c \u0434\u0430\u0436\u0435, \u0435\u0441\u043b\u0438 \u0432\u044b \u043f\u0438\u0448\u0435\u0442\u0435 \u043a\u043e\u0434 \u0431\u0435\u0437 \u043e\u0448\u0438\u0431\u043e\u043a, \u0442\u043e \u044d\u0442\u043e \u043d\u0435 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u044f \u0444\u0430\u043d\u0442\u043e\u043c\u043d\u044b\u0445 double. \u041e\u043d\u0438 \u043c\u043e\u0433\u0443\u0442 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438\u0437 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0438 \u043d\u0430 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0437\u0430\u043c\u0435\u0434\u043b\u044f\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432.<\/p>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0431\u044b\u043b \u0434\u043e\u0441\u0442\u0438\u0433\u043d\u0443\u0442: \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0438\u0437\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0445 \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u043e\u0442 <code>double<\/code> \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0435 \u0434\u043b\u044f Cortex-M4F. \u0412\u0441\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043a\u043e\u0434\u0430 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0435. \u0420\u0430\u0431\u043e\u0442\u0430 \u0437\u0430\u043d\u044f\u043b\u0430 \u043e\u043a\u043e\u043b\u043e 6 \u0447\u0430\u0441\u043e\u0432. \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u0432 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0435 \u043e\u043a\u043e\u043b\u043e 80.<\/p>\n<p>\u041d\u0430\u043f\u043e\u0441\u043b\u0435\u0434\u043e\u043a \u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u0438\u0437\u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0430 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430 \u043a\u043e\u0434\u0430 \u0434\u043e \u0438 \u043f\u043e\u0441\u043b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/webt\/qi\/n8\/mo\/qin8moyspvl-55nd_toyhzc2l3a.jpeg\" alt=\"\u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0434\u0438\u0437\u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043e (\u0441\u043b\u0435\u0432\u0430) \u0438 \u043f\u043e\u0441\u043b\u0435 (\u0441\u043f\u0440\u0430\u0432\u0430) \u0438\u0437\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043e\u0442 \u0444\u0430\u043d\u0442\u043e\u043c\u043d\u044b\u0445 double \u0442\u0438\u043f\u043e\u0432\" title=\"\u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0434\u0438\u0437\u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043e (\u0441\u043b\u0435\u0432\u0430) \u0438 \u043f\u043e\u0441\u043b\u0435 (\u0441\u043f\u0440\u0430\u0432\u0430) \u0438\u0437\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043e\u0442 \u0444\u0430\u043d\u0442\u043e\u043c\u043d\u044b\u0445 double \u0442\u0438\u043f\u043e\u0432\" width=\"1775\" height=\"844\" data-src=\"https:\/\/habrastorage.org\/webt\/qi\/n8\/mo\/qin8moyspvl-55nd_toyhzc2l3a.jpeg\" data-blurred=\"true\"\/><\/p>\n<div><figcaption>\u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0434\u0438\u0437\u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043e (\u0441\u043b\u0435\u0432\u0430) \u0438 \u043f\u043e\u0441\u043b\u0435 (\u0441\u043f\u0440\u0430\u0432\u0430) \u0438\u0437\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043e\u0442 \u0444\u0430\u043d\u0442\u043e\u043c\u043d\u044b\u0445 double \u0442\u0438\u043f\u043e\u0432<\/figcaption><\/div>\n<\/figure>\n<p><em>\u0410\u0432\u0442\u043e\u0440\u044b: \u0417\u0430\u043f\u0443\u043d\u0438\u0434\u0438 \u0421\u0435\u0440\u0433\u0435\u0439, \u0428\u0430\u043c\u043f\u043b\u0435\u0442\u043e\u0432 \u041d\u0438\u043a\u0438\u0442\u0430<\/em><\/p>\n<\/p>\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\/734604\/\"> https:\/\/habr.com\/ru\/articles\/734604\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><\/figure>\n<p>\u0412 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u044f\u0432\u0438\u043b\u043e\u0441\u044c \u043c\u043d\u043e\u0433\u043e \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432 \u043d\u0430 \u044f\u0434\u0440\u0430\u0445 ARM Cortex-M*, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 \u0430\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0438 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0437\u0430\u043f\u044f\u0442\u043e\u0439 (FPU). \u0412 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c FPU \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0441 \u043e\u0434\u0438\u043d\u043e\u0447\u043d\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e (<strong>float<\/strong>) \u0438 \u0435\u0451 \u0432\u043f\u043e\u043b\u043d\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0441\u0438\u0433\u043d\u0430\u043b\u0430\u043c\u0438, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u043c\u0438 \u0441 \u0410\u0426\u041f. FPU \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0437\u0430\u0431\u044b\u0442\u044c \u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u0445 \u0434\u0438\u0441\u043a\u0440\u0435\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u0445 \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0446\u0435\u043b\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0445 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439. FPU \u0431\u044b\u0441\u0442\u0440 &#8212; \u0432\u0441\u0435 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0441 \u043e\u0434\u0438\u043d\u043e\u0447\u043d\u044b\u043c\u0438 <code>float<\/code>, \u043a\u0440\u043e\u043c\u0435 \u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0438 \u0432\u0437\u044f\u0442\u0438\u044f \u043a\u043e\u0440\u043d\u044f, \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0442 \u043d\u0430 Cortex-M4F <a href=\"https:\/\/developer.arm.com\/documentation\/ddi0439\/b\/Floating-Point-Unit\/FPU-Functional-Description\/FPU-instruction-set\" rel=\"noopener noreferrer nofollow\">\u043e\u0434\u0438\u043d \u0442\u0430\u043a\u0442<\/a>. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u043d\u0430 Cortex-M4F \u043c\u044b \u0432\u0437\u0434\u043e\u0445\u043d\u0443\u043b\u0438 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u043e \u0438 \u0441\u0442\u0430\u043b\u0438 \u043f\u0438\u0441\u0430\u0442\u044c \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0443 \u043d\u0430 <code>float<\/code>. \u041a\u0430\u043a \u0436\u0435 \u043c\u044b \u0443\u0434\u0438\u0432\u0438\u043b\u0438\u0441\u044c, \u043d\u0430\u0439\u0434\u044f \u0432 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u043a\u043e\u0434\u0435 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043d\u0430\u0434 <code>double<\/code> \u0441 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0439, <a href=\"https:\/\/habr.com\/ru\/post\/591925\/\" rel=\"noopener noreferrer nofollow\">\u043e\u0447\u0435\u043d\u044c \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e\u0439 \u044d\u043c\u0443\u043b\u044f\u0446\u0438\u0435\u0439<\/a>.<\/p>\n<p>\u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u043a\u0430\u043a <strong>\u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442\u044c<\/strong> \u0438 <strong>\u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c<\/strong> \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 double \u0432 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0430\u0445, \u0433\u0434\u0435 \u044f\u0434\u0440\u043e \u0430\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0442\u0438\u043f <code>float<\/code>, \u043d\u043e \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 <code>double<\/code>. <\/p>\n<p>\u0420\u0430\u0431\u043e\u0442\u0430 \u0432\u0435\u0434\u0451\u0442\u0441\u044f \u0432 \u0441\u0440\u0435\u0434\u0435 IAR Embedded Workbench \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 \u0421\u0438.<\/p>\n<h3>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 double \u0447\u0438\u0441\u0435\u043b \u0432 ARM Cortex-M*<\/h3>\n<p>\u0410 \u0432\u0435\u043b\u0438\u043a\u0430 \u043b\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430, \u0447\u0442\u043e \u0447\u0430\u0441\u0442\u044c \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043b\u0430\u0441\u044c \u0441 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0439 \u044d\u043c\u0443\u043b\u044f\u0446\u0438\u0435\u0439 <code>double<\/code>, \u0432\u043c\u0435\u0441\u0442\u043e \u0430\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u0445 <code>float<\/code>? \u0412\u043e\u0442 <a href=\"https:\/\/habr.com\/ru\/post\/591925\/\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a> \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e <code>double<\/code> \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435 \u0432 <strong>27 \u0440\u0430\u0437<\/strong>, \u0430 <a href=\"http:\/\/www.ganssle.com\/tem\/tem369.html#article2\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a> \u0447\u0438\u0441\u043b\u0430 \u043f\u043e\u043c\u0435\u043d\u044c\u0448\u0435 (\u044f \u043d\u0430\u0441\u0447\u0438\u0442\u0430\u043b \u0440\u0430\u0437\u043d\u0438\u0446\u0443 \u0432 <strong>7-15 \u0440\u0430\u0437<\/strong>). \u0421\u043e\u0433\u043b\u0430\u0441\u0438\u0442\u0435\u0441\u044c, \u0447\u0442\u043e \u0442\u0435\u0440\u044f\u0442\u044c \u0432 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u043d\u0430 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0438\u0437-\u0437\u0430 \u043e\u0448\u0438\u0431\u043e\u0447\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f <code>double<\/code>, \u0433\u0434\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e <code>float<\/code>, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0433\u0440\u0443\u0441\u0442\u043d\u043e. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0444\u0430\u043d\u0442\u043e\u043c\u043d\u044b\u0445 <code>double<\/code> \u0438\u043d\u043e\u0433\u0434\u0430 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f <a href=\"https:\/\/dzone.com\/articles\/be-aware-floating-point-operations-on-arm-cortex-m\" rel=\"noopener noreferrer nofollow\">\u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c FPU<\/a>:<\/p>\n<blockquote>\n<p>My mantra is <em>not<\/em> to use any floating point data types in embedded applications,<br \/> or at least to avoid them whenever possible: for most applications they are not<br \/> necessary and can be replaced by fixed point operations. Not only floating point<br \/> operations have numerical problems, but they can also lead to performance problems&#8230;<\/p>\n<\/blockquote>\n<p>\u041d\u0443 \u0430 \u043c\u044b \u0431\u043e\u044f\u0442\u044c\u0441\u044f <em>performance problems<\/em> \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u0438 \u043d\u0430\u0443\u0447\u0438\u043c\u0441\u044f \u0444\u0430\u043d\u0442\u043e\u043c\u043d\u044b\u0445 <code>double<\/code> \u0438\u0437\u0431\u0435\u0433\u0430\u0442\u044c.<\/p>\n<p>\u041d\u0430\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b \u044f\u0434\u0440\u0430 Cortex-M, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 FPU \u0434\u043b\u044f single precision \u0435\u0441\u0442\u044c, \u0430 \u0434\u043b\u044f double precision &#8212; \u043d\u0435\u0442. \u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0430 <a href=\"https:\/\/www.arm.com\/products\/silicon-ip-cpu?families=cortex-m&amp;showall=true\" rel=\"noopener noreferrer nofollow\">\u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u044f\u0434\u0435\u0440 Cortex-M<\/a>. \u041d\u0430\u043b\u0438\u0447\u0438\u0435 FPU \u0443 \u043f\u043e\u043c\u0435\u0447\u0435\u043d\u043d\u044b\u0445 \u2705 \u044f\u0434\u0435\u0440 \u043e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e. \u042f\u0434\u0440\u0430, \u0438\u043c\u0435\u044e\u0449\u0438\u0435 \u044d\u0442\u043e\u0442 \u0431\u043b\u043e\u043a, \u0447\u0430\u0441\u0442\u043e <a href=\"https:\/\/www.electronicshub.org\/arm-introduction\/\" rel=\"noopener noreferrer nofollow\">\u043f\u043e\u043c\u0435\u0447\u0430\u044e\u0442\u0441\u044f \u0441\u0443\u0444\u0444\u0438\u043a\u0441\u043e\u043c<\/a> F: \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, Cortex-M4F.<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"center\">\u0412\u0435\u0440\u0441\u0438\u044f \u044f\u0434\u0440\u0430<\/p>\n<\/th>\n<th>\n<p align=\"center\">FPU (half precision)<\/p>\n<\/th>\n<th>\n<p align=\"center\">FPU (single precision)<\/p>\n<\/th>\n<th>\n<p align=\"center\">FPU (double precision)<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\">Cortex-M0<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u274c<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u274c<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u274c<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\">Cortex-M0+<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u274c<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u274c<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u274c<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\">Cortex-M1<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u274c<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u274c<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u274c<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\">Cortex-M3<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u274c<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u274c<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u274c<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\">Cortex-M4<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u274c<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u2705 (Optional)<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u274c<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\">Cortex-M7<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u274c<\/p>\n<\/td>\n<td colspan=\"2\">\n<p align=\"center\">\u2705 (Optional)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\">Cortex-M23<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u274c<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u274c<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u274c<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\">Cortex-M33<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u274c<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u2705 (Optional)<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u274c<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\">Cortex-M35P<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u274c<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u2705 (Optional)<\/p>\n<\/td>\n<td>\n<p align=\"center\">\u274c<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\">Cortex-M55<\/p>\n<\/td>\n<td colspan=\"3\">\n<p align=\"center\">\u2705 (Optional)<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\">Cortex-M85<\/p>\n<\/td>\n<td colspan=\"3\">\n<p align=\"center\">\u2705 (Optional)<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h3>\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u0430\u044f \u044d\u043c\u0443\u043b\u044f\u0446\u0438\u044f<\/h3>\n<p>\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442 \u0421\u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0447\u0438\u0441\u0435\u043b \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0442\u043e\u0447\u043a\u043e\u0439, \u043a\u0430\u043a <code>float<\/code>, \u0442\u0430\u043a \u0438 <code>double<\/code>. \u041a\u0430\u043a \u0436\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043a\u043e\u0434 \u0434\u043b\u044f \u044f\u0434\u0435\u0440 \u0431\u0435\u0437 \u0430\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u043e\u0439 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0434\u0440\u043e\u0431\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432? \u041a\u0430\u0436\u0434\u0430\u044f \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u0432\u044b\u0437\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <em>\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0439 \u044d\u043c\u0443\u043b\u044f\u0446\u0438\u0438<\/em>. \u0423 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 \u0441\u0432\u043e\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u044d\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u043e\u0432. <strong>\u0412\u0441\u044f\u043a\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 \u0434\u0440\u043e\u0431\u043d\u044b\u043c\u0438 \u0442\u0438\u043f\u0430\u043c\u0438 \u043d\u0430 \u044f\u0434\u0440\u0430\u0445 \u0431\u0435\u0437 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e FPU \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u0442 \u043a \u0432\u044b\u0437\u043e\u0432\u0443 \u044d\u043c\u0443\u043b\u0438\u0440\u0443\u044e\u0449\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439!<\/strong> \u0411\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e, \u0435\u0441\u043b\u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043d\u0435 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043e\u043f\u0446\u0438\u044e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 FPU \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430, \u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u0430\u044f \u044d\u043c\u0443\u043b\u044f\u0446\u0438\u044f \u0434\u043b\u044f \u0447\u0438\u0441\u0435\u043b \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0437\u0430\u043f\u044f\u0442\u043e\u0439, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u043c\u043e\u0433\u043b\u0438 \u0431\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u0430\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u043e.<\/p>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043b\u0443\u0447\u0430\u0439 \u044d\u043c\u0443\u043b\u044f\u0446\u0438\u0438 \u0447\u0438\u0441\u0435\u043b \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0437\u0430\u043f\u044f\u0442\u043e\u0439.<\/p>\n<pre><code class=\"cpp\">\/\/ Example for no-FPU device const int N = 1000; int half_of_N;  \/\/ 1) Inefficient way half_of_N = 0.5 * N;  \/\/ C standard treats 0.5 as double literal  \/\/ 2) Optimized way half_of_N = N \/ 2;<\/code><\/pre>\n<p>\u0423\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u0446\u0435\u043b\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u043d\u0430 <code>0.5<\/code> \u043f\u0440\u043e\u0439\u0434\u0435\u0442 \u0432 \u0447\u0435\u0442\u044b\u0440\u0435 \u044d\u0442\u0430\u043f\u0430:<\/p>\n<ol>\n<li>\n<p>\u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u044f N \u0432 <code>double<\/code> \u0442\u0438\u043f, \u0432\u044b\u0437\u043e\u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>..._i2d()<\/code><\/p>\n<\/li>\n<li>\n<p>\u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 <code>double<\/code> \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b <code>0.5<\/code> \u043d\u0430 \u0441\u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0432 <code>double<\/code> N, \u0442.\u0435. \u0432\u044b\u0437\u043e\u0432 \u044d\u043c\u0443\u043b\u0438\u0440\u0443\u044e\u0449\u0435\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 &#8212; <code>..._dmul()<\/code><\/p>\n<\/li>\n<li>\n<p>\u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0432 <code>int<\/code> &#8212; \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>..._d2i()<\/code><\/p>\n<\/li>\n<li>\n<p>\u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u0432 half_of_N.<\/p>\n<\/li>\n<\/ol>\n<p>\u041f\u0440\u043e\u0441\u0442\u043e\u0435 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u0434\u0440\u043e\u0431\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u043d\u0430 \u044f\u0434\u0440\u0435 \u0431\u0435\u0437 FPU \u043f\u0440\u0438\u0432\u0435\u043b\u043e \u043a \u0432\u044b\u0437\u043e\u0432\u0443 \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u0442\u0440\u0451\u0445 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439. \u0411\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e, \u0432 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0443 \u0431\u044b\u043b\u0438 \u043f\u0440\u0438\u043b\u0438\u043d\u043a\u043e\u0432\u0430\u043d\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u044d\u0442\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0447\u0442\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u0435\u0451 \u0440\u0430\u0437\u043c\u0435\u0440 \u0433\u0440\u0443\u0431\u043e \u043d\u0430 <a href=\"http:\/\/www.ganssle.com\/tem\/tem369.html#article2\" rel=\"noopener noreferrer nofollow\">1 \u043a\u0411<\/a>. \u0427\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0430 \u043d\u0435 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u043b\u0430\u0441\u044c \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 <strong>\u0432\u0441\u0435<\/strong> \u043c\u0435\u0441\u0442\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0439 \u044d\u043c\u0443\u043b\u044f\u0446\u0438\u0438 \u0438 \u0443\u0431\u0440\u0430\u0442\u044c \u0438\u0445.<\/p>\n<h3>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u044f double \u044d\u043c\u0443\u043b\u044f\u0446\u0438\u0438<\/h3>\n<p>\u0418\u0442\u0430\u043a, \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u043d\u0435\u0442 \u043b\u0438 \u0432 \u043d\u0430\u0448\u0435\u0439 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0435 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f double. \u0418\u043d\u043e\u0433\u0434\u0430 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0443 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u0441\u0430\u043c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 (<a href=\"https:\/\/community.arm.com\/arm-community-blogs\/b\/architectures-and-processors-blog\/posts\/10-useful-tips-to-using-the-floating-point-unit-on-the-arm-cortex--m4-processor\" rel=\"noopener noreferrer nofollow\">c\u0441\u044b\u043b\u043a\u0430<\/a>, \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438). \u0422\u0430\u043a, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, gcc \u0438\u043c\u0435\u0435\u0442 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0444\u043b\u0430\u0433 <code>-Wdouble-promotion<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u043e\u043f\u043e\u0432\u0435\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430 \u043e \u043d\u0435\u044f\u0432\u043d\u043e\u0439 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u0438 <code>float<\/code> \u0432 <code>double<\/code>. \u0422\u0430\u043a\u0436\u0435 \u0434\u0440\u043e\u0431\u043d\u044b\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u043a\u0430\u043a <code>float<\/code>, \u0435\u0441\u043b\u0438 gcc \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0444\u043b\u0430\u0433 <code>-fsingle-precision-constant<\/code>. \u0412 <strong>IAR Embedded Workbench<\/strong> \u043d\u0435\u0442 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0433\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b. \u041f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c\u0441\u044f \u0440\u0435\u0432\u0435\u0440\u0441\u043e\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0438 \u0441 \u043a\u043e\u043d\u0446\u0430.<\/p>\n<ol>\n<li>\n<p>\u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u043f\u0440\u043e\u0435\u043a\u0442 \u0438 \u043f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u0432 \u0435\u0433\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043f\u043e\u0434\u043f\u0443\u043d\u043a\u0442 <code>Linker->List<\/code> \u0438 \u043f\u043e\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u0433\u0430\u043b\u043e\u0447\u043a\u0443 \u0432 \u0447\u0435\u043a\u0431\u043e\u043a\u0441 <code>Generate linker map file<\/code>.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u041e\u043a\u043d\u043e \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0432\u044b\u0432\u043e\u0434\u0430 map \u0444\u0430\u0439\u043b\u0430 \u043b\u0438\u043d\u043a\u043e\u0432\u0449\u0438\u043a\u0430 IAR EWARM<\/figcaption><\/div>\n<\/figure>\n<\/li>\n<li>\n<p>\u0421\u043e\u0431\u0435\u0440\u0438\u0442\u0435 \u043f\u0440\u043e\u0435\u043a\u0442. \u0412 \u043f\u0430\u043f\u043a\u0435 output \u0432 \u0434\u0435\u0440\u0435\u0432\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f *.map \u0444\u0430\u0439\u043b.<\/p>\n<figure class=\"\">\n<div><figcaption>\u0414\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0432 \u043f\u0430\u043f\u043a\u0435 Output \u0444\u0430\u0439\u043b\u0430 *.map<\/figcaption><\/div>\n<\/figure>\n<\/li>\n<li>\n<p>\u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u0435\u0433\u043e \u0438 \u043e\u0442\u043b\u0438\u0441\u0442\u0430\u0439\u0442\u0435 \u0434\u043e \u0441\u0435\u043a\u0446\u0438\u0438 &#171;ENTRY LIST&#187;. \u0412 \u043d\u0435\u0439 \u0432\u044b \u043d\u0430\u0439\u0434\u0451\u0442\u0435 \u0438\u043c\u0435\u043d\u0430 \u0432\u0441\u0435\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0432 \u043a\u043e\u0434\u0435. \u0412 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0438 \u0432\u0441\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 <code>..._f2d()<\/code>,<code>..._dmul()<\/code> \u0438 \u043f\u0440\u043e\u0447\u0438\u0435.<\/p>\n<\/li>\n<li>\n<p>\u0414\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u043f\u043e\u0438\u0441\u043a \u043f\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u0438 <code>f2d<\/code>, <code>ui2d<\/code> \u0438 <code>l2d<\/code>. \u0412 \u043c\u043e\u0451\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044f \u043d\u0430\u0448\u0451\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 *.map \u0444\u0430\u0439\u043b\u0430 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0439 \u044d\u043c\u0443\u043b\u044f\u0446\u0438\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u043d\u0430\u0434 double<\/figcaption><\/div>\n<\/figure>\n<\/li>\n<\/ol>\n<p>\u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u0444\u0430\u043d\u0442\u043e\u043c\u043d\u044b\u0439 <code>double<\/code> \u0432 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0435 \u0435\u0441\u0442\u044c. \u041d\u0430 \u0441\u043a\u0438\u043d\u0448\u043e\u0442\u0435 \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0435\u0449\u0435 \u043c\u043d\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u0438 \u0442\u0438\u043f\u043e\u0432 \u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0439 \u044d\u043c\u0443\u043b\u044f\u0446\u0438\u0438 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0437\u0430\u043f\u044f\u0442\u043e\u0439. \u0412 \u043c\u043e\u043c\u0435\u043d\u0442 \u0438\u0437\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043e\u0442 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0442\u0438\u043f\u0430 <code>double<\/code> \u043e\u043d\u0438 \u0440\u0430\u0437\u043e\u043c \u0438\u0441\u0447\u0435\u0437\u043d\u0443\u0442.<\/p>\n<h3>\u041f\u043e\u0438\u0441\u043a double \u0432 \u043a\u043e\u0434\u0435.<\/h3>\n<p>\u041d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u044e, \u0447\u0442\u043e \u043c\u044b \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043a\u043e\u0434 \u0434\u043b\u044f \u044f\u0434\u0440\u0430 \u0441 FPU, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e <code>float<\/code>. Cortex-M4F, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440.<\/p>\n<h4>\u041f\u0435\u0440\u0432\u0430\u044f \u0441\u0442\u0443\u043f\u0435\u043d\u044c &#8212; \u043f\u043e\u0438\u0441\u043a \u043f\u043e \u0442\u0435\u043a\u0441\u0442\u0443 \u043a\u043e\u0434\u0430<\/h4>\n<p>\u041f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u043c \u043d\u0435\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a \u043f\u043e \u0432\u0441\u0435\u043c \u0444\u0430\u0439\u043b\u0430\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0430 (Ctrl+Shift+F) \u0441\u043b\u043e\u0432\u0430 <code>double<\/code>. \u041e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u0433\u0434\u0435-\u0442\u043e \u0440\u0443\u043a\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430 \u0434\u0440\u043e\u0433\u043d\u0443\u043b\u0430 \u0438 \u043e\u043d \u0435\u0433\u043e \u0432\u0441\u0451-\u0442\u0430\u043a\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043b.<\/p>\n<figure class=\"\">\n<div><figcaption>\u0412\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u0432 IAR EWARM \u043f\u043e\u0438\u0441\u043a \u043f\u043e \u0444\u0430\u0439\u043b\u0430\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441\u043b\u043e\u0432\u0430 double<\/figcaption><\/div>\n<\/figure>\n<p>\u0410 \u0432\u043e\u0442 \u0442\u0443\u0442 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0438\u0441\u043a\u0430\u0442\u044c \u0447\u0430\u0441\u0442\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443:<\/p>\n<pre><code class=\"cpp\">\/\/ ST5918L3008 parameters are used as default values. const static StepperParameters_t StepperParametersDefault = {   .L = 0.0076 * 0.1f, \/\/ H -> 0.1H   .R = 2.2 * 0.1f, \/\/ Ohm -> 0.1Ohm   .Fm = 0.009 * 100.0f, \/\/ Wb -> cWb };  static void StepperFOCSensorless_PIDReconfigureCallback(void) {   \/*    * Update PID if SPID was changed    * 1. Kp, Ki, Kd units in firmware: mA\/rad, mA\/(rad*T) and mA*T\/rad, where T is period.    * 2. Kp, Ki, Kd  units in GUI: A\/rad, A\/(rad*s), A*s\/rad but XiLab multiplies them on 0.001 before sending.    * 4. Parameters can be changed during movement.    *\/   \/\/ assign new values   PositionRegulator_param.Kp =  1e6 * BCDFlashParams.SPID.Kpf; \/\/ rad -> mA   PositionRegulator_param.Kd =  1e6 * BCDFlashParams.SPID.Kdf * STEPPER_FOC_PWM_FREQ ; \/\/ rad\/T -> mA   PositionRegulator_param.Ki =  1e6 * BCDFlashParams.SPID.Kif * STEPPER_FOC_PWM_PERIOD_FLOAT; \/\/ rad T -> mA }<\/code><\/pre>\n<p>\u042f\u0437\u044b\u043a C \u043a\u043e\u0432\u0430\u0440\u0435\u043d \u0442\u0435\u043c, \u0447\u0442\u043e \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432\u0441\u0435 \u0434\u0440\u043e\u0431\u043d\u044b\u0435 \u0447\u0438\u0441\u043b\u0430 \u0442\u0440\u0430\u043a\u0442\u0443\u0435\u0442 \u043a\u0430\u043a <code>double<\/code>. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code>0.0076<\/code> &#8212; \u044d\u0442\u043e <code>double<\/code>. \u0415\u0441\u043b\u0438 \u043c\u044b \u0443\u043c\u043d\u043e\u0436\u0430\u0435\u043c \u0435\u0433\u043e \u043d\u0430 <code>0.1f<\/code>, \u0442\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u0442\u0438\u043f \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f, \u043a\u0430\u043a \u0431\u043e\u043b\u0435\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u044b\u0439 \u0438\u0437 \u0434\u0432\u0443\u0445, \u0442\u043e \u0435\u0441\u0442\u044c <code>double<\/code>. \u0415\u0449\u0451 \u0431\u043e\u043b\u044c\u0448\u0435\u0435 \u043a\u043e\u0432\u0430\u0440\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0444\u043e\u0440\u043c\u043e\u0439: \u0447\u0438\u0441\u043b\u043e <code>1e6<\/code> \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0446\u0435\u043b\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u043c, \u0435\u0433\u043e \u0442\u0438\u043f \u0442\u043e\u0436\u0435 <code>double<\/code>. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0441\u0443\u0444\u0444\u0438\u043a\u0441 <code>f<\/code>\/<code>F<\/code> \u043d\u0430 \u043a\u043e\u043d\u0446\u0435 \u0447\u0438\u0441\u043b\u043e\u0432\u044b\u0445 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442, \u0447\u0442\u043e\u0431\u044b \u044f\u0432\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0442\u0438\u043f <code>float<\/code>. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <code>1e6f<\/code>.<\/p>\n<p>\u041a\u0430\u043a \u043d\u0430\u0439\u0442\u0438 \u0432 \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0435 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b? \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043f\u043e\u0438\u0441\u043a \u043f\u043e \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u043c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0441\u0442\u0440\u043e\u0435\u043d \u0432 IAR Embedded Workbench. \u0412\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 <code>[^\\.\\d\\w#][0-9]+[\\.eE][0-9]*[^\\.\\w0-9]<\/code>.<\/p>\n<figure class=\"\">\n<div><figcaption>\u0412\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u0432 IAR EWARM \u043f\u043e\u0438\u0441\u043a \u043f\u043e \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u043c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u043c \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 float \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442<\/figcaption><\/div>\n<\/figure>\n<p>\u0420\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0438\u0449\u0435\u0442 \u043d\u0435 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0435\u0441\u044f \u0441 \u0431\u0443\u043a\u0432, \u0442\u043e\u0447\u0435\u043a \u0438 # \u0446\u0438\u0444\u0440\u044b, \u0433\u0434\u0435 \u0435\u0441\u0442\u044c \u0442\u043e\u0447\u043a\u0430 \u0438\u043b\u0438 \u0431\u0443\u043a\u0432\u0430 \u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0432 \u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0435 \u0438\u043b\u0438 \u0432 \u043a\u043e\u043d\u0446\u0435, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u043d\u0435 \u0438\u0434\u0451\u0442 \u0442\u043e\u0447\u043a\u0430, \u0431\u0443\u043a\u0432\u0430 \u0438\u043b\u0438 \u0446\u0438\u0444\u0440\u0430. \u0422\u0430\u043a\u043e\u0435 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0434\u0430\u0451\u0442 \u043c\u043d\u043e\u0433\u043e \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0439 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445 \u043a \u043a\u043e\u0434\u0443, \u0447\u0442\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u0443\u0435\u0442\u0441\u044f \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e. \u041e\u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442 \u043d\u0435 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b <code>3e-4<\/code> \u0438\u043b\u0438 <code>1e3L<\/code>, \u043d\u0435 \u0438\u043c\u0435\u044e\u0449\u0438\u043c \u0442\u0438\u043f <code>float<\/code> , \u043d\u043e \u043c\u043d\u0435 \u0445\u0432\u0430\u0442\u0438\u043b\u043e \u0438 \u0442\u0430\u043a\u043e\u0433\u043e \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0433\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043e\u0448\u0438\u0431\u043a\u0438 \u043f\u043e\u0441\u043b\u043e\u0436\u043d\u0435\u0435:<\/p>\n<pre><code class=\"cpp\">  \/*    * right half of voltage cicle is inside current circle    * NOTE: if voltage circle is inside current circle (Imax > Iu + I0) then intersection point does not exists,    * but Iu^2 - Imax^2 - I0^ &lt; -2*I0^2 -2*I0*Iu and Id &lt; -I0 - Iu &lt;= I0    *\/   if (Id_limit &lt; -I0)   {     \/\/ FW_VOLTAGE_ONLY: limit only voltage     if (fabs(Irq) &lt; Iu)     {       pIr->d = -I0 + sqrtf(Iu * Iu - Irq * Irq);       if (pIr->d > 0)       {         pIr->d = 0.0f;       }       pIr->q = Irq;       return; \/\/ nolimit     }     else     {       pIr->d = -I0;       if (Irq > 0.0f)       {         pIr->q = Iu;       }       else       {         pIr->q = -Iu;       }       return; \/\/ limit     }   }    \/*    * Main case: Id_limit is between located between -I0 and 0.    *\/    \/*    * Check if line Iq = Irq intersects the voltage circle    * then  calculate intersection Id coordinate and check if it is is not greater then Id_limit    *\/   if (fabs(Irq) >= Iu || (Id_fw = -I0 + sqrtf(Iu * Iu - Irq * Irq)) &lt; Id_limit)   {     \/*      * LIMIT_MAIN_CASE: apply maximal current in Irq direction      *\/     pIr->d = Id_limit;     pIr->q = sqrtf(Imax * Imax - Id_limit * Id_limit);     if (Irq &lt; 0)     {       pIr->q = -pIr->q;     }     return; \/\/ limit   }<\/code><\/pre>\n<p>\u0412 \u044d\u0442\u043e\u043c \u043a\u043e\u0434\u0435 \u0432\u0441\u0435 \u0434\u0440\u043e\u0431\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0438\u043c\u0435\u044e\u0442 \u0442\u0438\u043f <code>float<\/code>, \u043d\u043e <code>double<\/code> \u0432\u0441\u0451-\u0442\u0430\u043a\u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442. \u0418 \u0434\u0435\u043b\u043e \u0432 \u0432\u044b\u0437\u043e\u0432\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0439. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0434\u043e\u0433\u0430\u0434\u0430\u0442\u044c\u0441\u044f \u043e \u043a\u0430\u043a\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438\u0434\u0451\u0442 \u0440\u0435\u0447\u044c. <\/p>\n<p>\u0410 \u043f\u043e\u043a\u0430 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0442\u0435\u043e\u0440\u0438\u0438 \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u0414\u043b\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432\u0437\u044f\u0442\u0438\u044f \u043a\u043e\u0440\u043d\u044f, \u0441\u0438\u043d\u0443\u0441\u0430, \u043a\u043e\u0441\u0438\u043d\u0443\u0441\u0430, \u0438 \u0434\u0430\u0436\u0435 \u0434\u043b\u044f \u043c\u043e\u0434\u0443\u043b\u044f \u0447\u0438\u0441\u043b\u0430 \u0435\u0441\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0438\u0435 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0438\u0435 \u0442\u0438\u043f <code>double<\/code>, \u0430 \u0435\u0441\u0442\u044c \u0438\u0445 \u0431\u043e\u043b\u0435\u0435 \u0431\u044b\u0441\u0442\u0440\u044b\u0435 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u044b, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0435 \u0441 \u0442\u0438\u043f\u043e\u043c <code>float<\/code>. \u041e\u043d\u0438 \u0438\u043c\u0435\u044e\u0442 \u0441\u0443\u0444\u0444\u0438\u043a\u0441 <code>f<\/code> \u0432 \u043a\u043e\u043d\u0446\u0435.<\/p>\n<pre><code class=\"cpp\">\/\/ Double functions sin(x);    \/\/ double cos(x);    \/\/ double sqrt(x);   \/\/ double fabs(x)    \/\/ double  \/\/ Float functions sinf(x);   \/\/ float alternative cosf(x);   \/\/ float alternative sqrtf(x);  \/\/ float alternative fabsf(x);  \/\/ float alternative <\/code><\/pre>\n<p>\u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u0435\u043b\u043e \u0431\u044b\u043b\u043e \u0432 <code>fabs()<\/code>. \u041d\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f, \u0438 \u043c\u043d\u0435 \u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e <code>fab<\/code><\/p>\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-402534","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/402534","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=402534"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/402534\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=402534"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=402534"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=402534"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}