Skip to content

Commit afade1d

Browse files
committed
Create README - LeetHub
1 parent 37a6e12 commit afade1d

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

0050-powx-n/README.md

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<h2><a href="https://leetcode.com/problems/powx-n/">50. Pow(x, n)</a></h2><h3>Medium</h3><hr><div><p>Implement <a href="http://www.cplusplus.com/reference/valarray/pow/" target="_blank">pow(x, n)</a>, which calculates <code>x</code> raised to the power <code>n</code> (i.e., <code>x<sup>n</sup></code>).</p>
2+
3+
<p>&nbsp;</p>
4+
<p><strong class="example">Example 1:</strong></p>
5+
6+
<pre><strong>Input:</strong> x = 2.00000, n = 10
7+
<strong>Output:</strong> 1024.00000
8+
</pre>
9+
10+
<p><strong class="example">Example 2:</strong></p>
11+
12+
<pre><strong>Input:</strong> x = 2.10000, n = 3
13+
<strong>Output:</strong> 9.26100
14+
</pre>
15+
16+
<p><strong class="example">Example 3:</strong></p>
17+
18+
<pre><strong>Input:</strong> x = 2.00000, n = -2
19+
<strong>Output:</strong> 0.25000
20+
<strong>Explanation:</strong> 2<sup>-2</sup> = 1/2<sup>2</sup> = 1/4 = 0.25
21+
</pre>
22+
23+
<p>&nbsp;</p>
24+
<p><strong>Constraints:</strong></p>
25+
26+
<ul>
27+
<li><code>-100.0 &lt; x &lt; 100.0</code></li>
28+
<li><code>-2<sup>31</sup> &lt;= n &lt;= 2<sup>31</sup>-1</code></li>
29+
<li><code>n</code> is an integer.</li>
30+
<li>Either <code>x</code> is not zero or <code>n &gt; 0</code>.</li>
31+
<li><code>-10<sup>4</sup> &lt;= x<sup>n</sup> &lt;= 10<sup>4</sup></code></li>
32+
</ul>
33+
</div>

0 commit comments

Comments
 (0)