{"id":2224,"date":"2022-01-21T16:01:46","date_gmt":"2022-01-21T08:01:46","guid":{"rendered":"http:\/\/139.9.1.231\/?p=2224"},"modified":"2022-01-21T16:01:47","modified_gmt":"2022-01-21T08:01:47","slug":"leetcodeday50","status":"publish","type":"post","link":"http:\/\/139.9.1.231\/index.php\/2022\/01\/21\/leetcodeday50\/","title":{"rendered":"leetcodeday50 &#8211;Pow(x, n)"},"content":{"rendered":"\n<p>\u5b9e\u73b0&nbsp;<a href=\"https:\/\/www.cplusplus.com\/reference\/valarray\/pow\/\">pow(<em>x<\/em>,&nbsp;<em>n<\/em>)<\/a>&nbsp;\uff0c\u5373\u8ba1\u7b97&nbsp;<code>x<\/code>&nbsp;\u7684&nbsp;<code>n<\/code>&nbsp;\u6b21\u5e42\u51fd\u6570\uff08\u5373\uff0c<code>x<sup>n<\/sup><\/code><sup>&nbsp;<\/sup>\uff09\u3002<\/p>\n\n\n\n<p><strong>\u793a\u4f8b 1\uff1a<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>\u8f93\u5165\uff1a<\/strong>x = 2.00000, n = 10\n<strong>\u8f93\u51fa\uff1a<\/strong>1024.00000\n<\/pre>\n\n\n\n<p><strong>\u793a\u4f8b 2\uff1a<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>\u8f93\u5165\uff1a<\/strong>x = 2.10000, n = 3\n<strong>\u8f93\u51fa\uff1a<\/strong>9.26100\n<\/pre>\n\n\n\n<p><strong>\u793a\u4f8b 3\uff1a<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>\u8f93\u5165\uff1a<\/strong>x = 2.00000, n = -2\n<strong>\u8f93\u51fa\uff1a<\/strong>0.25000\n<strong>\u89e3\u91ca\uff1a<\/strong>2<sup>-2<\/sup> = 1\/2<sup>2<\/sup> = 1\/4 = 0.25<\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code># &#91;50] Pow(x, n)\n#\n\n# @lc code=start\nclass Solution:\n    def myPow(self, x: float, n: int) -&gt; float:\n        return pow(x, n)<\/code><\/pre>\n\n\n\n<div class=\"wp-block-image is-style-default\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" src=\"http:\/\/139.9.1.231\/wp-content\/uploads\/2022\/01\/image-257.png\" alt=\"\" class=\"wp-image-2226\" width=\"439\" height=\"149\" srcset=\"http:\/\/139.9.1.231\/wp-content\/uploads\/2022\/01\/image-257.png 776w, http:\/\/139.9.1.231\/wp-content\/uploads\/2022\/01\/image-257-300x102.png 300w, http:\/\/139.9.1.231\/wp-content\/uploads\/2022\/01\/image-257-768x260.png 768w\" sizes=\"(max-width: 439px) 100vw, 439px\" \/><\/figure><\/div>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5b9e\u73b0&nbsp;pow(x,&nbsp;n)&nbsp;\uff0c\u5373\u8ba1\u7b97&nbsp;x&nbsp;\u7684&nbsp;n&#038;n &hellip; <a href=\"http:\/\/139.9.1.231\/index.php\/2022\/01\/21\/leetcodeday50\/\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">leetcodeday50 &#8211;Pow(x, n)<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[6],"tags":[],"_links":{"self":[{"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/posts\/2224"}],"collection":[{"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/comments?post=2224"}],"version-history":[{"count":4,"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/posts\/2224\/revisions"}],"predecessor-version":[{"id":2229,"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/posts\/2224\/revisions\/2229"}],"wp:attachment":[{"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/media?parent=2224"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/categories?post=2224"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/tags?post=2224"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}