{"id":945,"date":"2026-02-26T09:55:48","date_gmt":"2026-02-26T00:55:48","guid":{"rendered":"https:\/\/csharp.ihavenomoney.co.kr\/?p=945"},"modified":"2026-03-20T10:22:51","modified_gmt":"2026-03-20T01:22:51","slug":"math-pow%eb%b0%91-%ec%a7%80%ec%88%98","status":"publish","type":"post","link":"https:\/\/csharp.ihavenomoney.co.kr\/?p=945","title":{"rendered":"Math.Pow(\ubc11, \uc9c0\uc218)"},"content":{"rendered":"\n<p>C#\uc5d0\uc11c <code>Math.Pow<\/code>\ub294 <strong>\uac70\ub4ed\uc81c\uacf1(\uc81c\uacf1 \uc5f0\uc0b0)<\/strong> \uc744 \ud558\ub294 \ud568\uc218\uc785\ub2c8\ub2e4.<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:c# decode:true \">decimal actualAmount = value \/ (decimal)Math.Pow(10, decPos);<\/pre><\/div>\n\n\n\n<ul class=\"wp-block-list\">\n<li>value = 65600<\/li>\n\n\n\n<li>decPos = 2<\/li>\n<\/ul>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:default decode:true \">Math.Pow(10, 2) = 100<\/pre><\/div>\n\n\n\n<p>65600 \/ 100 = 656.00<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\ubc18\ud658\ud615\uc740 <code>double<\/code><\/h4>\n\n\n\n<p>\uadf8\ub798\uc11c decimal \uacc4\uc0b0\ud560 \ub54c\ub294 \ubc18\ub4dc\uc2dc \uce90\uc2a4\ud305 \ud544\uc694:<\/p>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:default decode:true \">(decimal)Math.Pow(10, decPos)<\/pre><\/div>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:default decode:true \">decimal divisor = 1m;\n\nfor (int i = 0; i &lt; decPos; i++)\n{\n    divisor *= 10m;\n}\n\ndecimal actualAmount = value \/ divisor;<\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udd2c \ub0b4\ubd80 \ub3d9\uc791 \uc6d0\ub9ac<\/h3>\n\n\n\n<p><code>Math.Pow(10, 3)<\/code> \uc740 \ub0b4\ubd80\uc801\uc73c\ub85c<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">10 \u00d7 10 \u00d7 10<\/pre>\n\n\n\n<p>\uc744 \uacc4\uc0b0\ud574\uc11c <code>1000<\/code> \ubc18\ud658<\/p>\n\n\n\n<p>\ud558\uc9c0\ub9cc double \uae30\ubc18 \uacc4\uc0b0\uc774\ub77c<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">1000.0000000000001<\/pre>\n\n\n\n<p>\uac19\uc740 \ubbf8\uc138 \uc624\ucc28\uac00 \uc788\uc744 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Sample<\/h3>\n\n\n\n<div class=\"wp-block-urvanov-syntax-highlighter-code-block\"><pre class=\"lang:default decode:true \">if (int.TryParse(BaseDecPos, out int decPos) &amp;&amp; decPos &gt;= 0)\n{\n    decimal divisor = 1m;\n\n    for (int i = 0; i &lt; decPos; i++)\n        divisor *= 10m;\n\n    decimal actualAmount = value \/ divisor;\n\n    string formatted = actualAmount.ToString(\"N\" + decPos, new CultureInfo(\"en-US\"));\n\n    doc.XPathSelectElement(\"\/\/GenQuoteDetails\/BaseFareAmt\").Value = formatted;\n}<\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"<p>C#\uc5d0\uc11c Math.Pow\ub294 \uac70\ub4ed\uc81c\uacf1(\uc81c\uacf1 \uc5f0\uc0b0) \uc744 \ud558\ub294 \ud568\uc218\uc785\ub2c8\ub2e4. 65600 \/ 100 = 656.00 \ubc18\ud658\ud615\uc740 double \uadf8\ub798\uc11c decimal \uacc4\uc0b0\ud560 \ub54c\ub294 \ubc18\ub4dc\uc2dc \uce90\uc2a4\ud305 \ud544\uc694: \ud83d\udd2c \ub0b4\ubd80 \ub3d9\uc791 \uc6d0\ub9ac Math.Pow(10, 3) \uc740 \ub0b4\ubd80\uc801\uc73c\ub85c 10 \u00d7 10 \u00d7 10 \uc744 \uacc4\uc0b0\ud574\uc11c 1000 \ubc18\ud658 \ud558\uc9c0\ub9cc double \uae30\ubc18 \uacc4\uc0b0\uc774\ub77c 1000.0000000000001 \uac19\uc740 \ubbf8\uc138 \uc624\ucc28\uac00 \uc788\uc744 \uc218 \uc788\uc2b5\ub2c8\ub2e4. Sample<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[74],"tags":[],"class_list":["post-945","post","type-post","status-publish","format-standard","hentry","category-c-form"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/csharp.ihavenomoney.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/945","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/csharp.ihavenomoney.co.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/csharp.ihavenomoney.co.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/csharp.ihavenomoney.co.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/csharp.ihavenomoney.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=945"}],"version-history":[{"count":2,"href":"https:\/\/csharp.ihavenomoney.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/945\/revisions"}],"predecessor-version":[{"id":949,"href":"https:\/\/csharp.ihavenomoney.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/945\/revisions\/949"}],"wp:attachment":[{"href":"https:\/\/csharp.ihavenomoney.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=945"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/csharp.ihavenomoney.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=945"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/csharp.ihavenomoney.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=945"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}