mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-06-18 05:26:57 +08:00
129 lines
5.2 KiB
HTML
129 lines
5.2 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
|
<title>任意精度数字的乘方</title>
|
|
</head>
|
|
<body class="docs"><div id="layout">
|
|
<div id="layout-content"><div id="function.bcpow" class="refentry">
|
|
<div class="refnamediv">
|
|
<h1 class="refname">bcpow</h1>
|
|
<p class="verinfo">(PHP 4, PHP 5, PHP 7)</p><p class="refpurpose"><span class="refname">bcpow</span> — <span class="dc-title">任意精度数字的乘方</span></p>
|
|
|
|
</div>
|
|
|
|
<div class="refsect1 description" id="refsect1-function.bcpow-description">
|
|
<h3 class="title">说明</h3>
|
|
<div class="methodsynopsis dc-description">
|
|
<span class="methodname"><strong>bcpow</strong></span>
|
|
( <span class="methodparam"><span class="type">string</span> <code class="parameter">$left_operand</code></span>
|
|
, <span class="methodparam"><span class="type">string</span> <code class="parameter">$right_operand</code></span>
|
|
[, <span class="methodparam"><span class="type">int</span> <code class="parameter">$scale</code></span>
|
|
] ) : <span class="type">string</span></div>
|
|
|
|
<p class="para rdfs-comment">
|
|
<code class="parameter">左操作数</code>的<code class="parameter">右操作数</code>次方运算.
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 parameters" id="refsect1-function.bcpow-parameters">
|
|
<h3 class="title">参数</h3>
|
|
<p class="para">
|
|
<dl>
|
|
|
|
|
|
<dt>
|
|
<code class="parameter">left_operand</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
字符串类型的左操作数.
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
|
|
<dt>
|
|
<code class="parameter">right_operand</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
字符串类型的右操作数.
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
<dt>
|
|
<code class="parameter">
|
|
scale</code></dt>
|
|
<dd>
|
|
<p class="para">此可选参数用于设置结果中小数点后的小数位数。也可通过使用
|
|
<span class="function"><a href="bcscale.html" class="function">bcscale()</a></span> 来设置全局默认的小数位数,用于所有函数。
|
|
</p></dd>
|
|
|
|
</dl>
|
|
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 returnvalues" id="refsect1-function.bcpow-returnvalues">
|
|
<h3 class="title">返回值</h3>
|
|
<p class="para">
|
|
返回结果为字符串类型.
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 examples" id="refsect1-function.bcpow-examples">
|
|
<h3 class="title">范例</h3>
|
|
<div class="example" id="example-4056">
|
|
<p><strong>Example #1 <span class="function"><strong>bcpow()</strong></span> 示例</strong></p>
|
|
<div class="example-contents">
|
|
<div class="phpcode"><pre><span style="color: #000000">
|
|
<span style="color: #0000BB"><?php<br /><br /></span><span style="color: #007700">echo </span><span style="color: #0000BB">bcpow</span><span style="color: #007700">(</span><span style="color: #DD0000">'4.2'</span><span style="color: #007700">, </span><span style="color: #DD0000">'3'</span><span style="color: #007700">, </span><span style="color: #0000BB">2</span><span style="color: #007700">); </span><span style="color: #FF8000">// 74.08<br /><br /></span><span style="color: #0000BB">?></span>
|
|
</span>
|
|
</pre></div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 notes" id="refsect1-function.bcpow-notes">
|
|
<h3 class="title">注释</h3>
|
|
<blockquote class="note"><p><strong class="note">Note</strong>:
|
|
<p class="para">
|
|
<span class="function"><strong>bcpow()</strong></span> may return a result with fewer digits after the
|
|
decimal point than the <code class="parameter">scale</code> parameter would
|
|
indicate. This only occurs when the result doesn't require all of the
|
|
precision allowed by the <code class="parameter">scale</code>. For example:
|
|
<div class="example" id="example-4057">
|
|
<p><strong>Example #2 <span class="function"><strong>bcpow()</strong></span> scale example</strong></p>
|
|
<div class="example-contents">
|
|
<div class="phpcode"><pre><span style="color: #000000">
|
|
<span style="color: #0000BB"><?php<br /></span><span style="color: #007700">echo </span><span style="color: #0000BB">bcpow</span><span style="color: #007700">(</span><span style="color: #DD0000">'5'</span><span style="color: #007700">, </span><span style="color: #DD0000">'2'</span><span style="color: #007700">, </span><span style="color: #0000BB">2</span><span style="color: #007700">); </span><span style="color: #FF8000">// prints "25", not "25.00"<br /></span><span style="color: #0000BB">?></span>
|
|
</span>
|
|
</pre></div>
|
|
</div>
|
|
|
|
</div>
|
|
</p>
|
|
</p></blockquote>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 seealso" id="refsect1-function.bcpow-seealso">
|
|
<h3 class="title">参见</h3>
|
|
<p class="para">
|
|
<ul class="simplelist">
|
|
<li class="member"><span class="function"><a href="bcpowmod.html" class="function" rel="rdfs-seeAlso">bcpowmod()</a> - Raise an arbitrary precision number to another, reduced by a specified modulus</span></li>
|
|
<li class="member"><span class="function"><a href="bcsqrt.html" class="function" rel="rdfs-seeAlso">bcsqrt()</a> - 任意精度数字的二次方根</span></li>
|
|
</ul>
|
|
</p>
|
|
</div>
|
|
|
|
</div></div></div></body></html> |