Home >Backend Development >C#.Net Tutorial >How to express the tenth power in C language
The C language has two ways to express the power of ten: the exponentiation symbol (^) and the macro (#define). Exponential operations only work with integer exponents, while macro expansion allows floating-point exponents.
Two ways to express the tenth power in C language
Power operation symbol (^)
<code class="c">pow(基数, 指数)</code>
For example: to find the 10th power of 2, you can use:
<code class="c">pow(2, 10); // 结果为 1024</code>
Macro
<code class="c">#define BASE 10 int result = BASE ^ 指数;</code>
For example: to find the 10th power of 10 Square, you can use:
<code class="c">#define BASE 10 int result = BASE ^ 10; // 结果为 10000000000</code>
Note:
The above is the detailed content of How to express the tenth power in C language. For more information, please follow other related articles on the PHP Chinese website!