reference/bc/functions/bcpow.xml
23f5599c8cc2713e7a4fdc29d8cceab66c341c48
...
...
@@ -10,13 +10,13 @@
10
10
&reftitle.description;
11
11
<methodsynopsis>
12
12
<type>string</type><methodname>bcpow</methodname>
13
-
<methodparam><type>string</type><parameter>left_operand</parameter></methodparam>
14
-
<methodparam><type>string</type><parameter>right_operand</parameter></methodparam>
15
-
<methodparam choice="opt"><type>int</type><parameter>scale</parameter><initializer>0</initializer></methodparam>
13
+
<methodparam><type>string</type><parameter>num</parameter></methodparam>
14
+
<methodparam><type>string</type><parameter>exponent</parameter></methodparam>
15
+
<methodparam choice="opt"><type class="union"><type>int</type><type>null</type></type><parameter>scale</parameter><initializer>&null;</initializer></methodparam>
16
16
</methodsynopsis>
17
17
<para>
18
-
Raise <parameter>left_operand</parameter> to the power
19
-
<parameter>right_operand</parameter>.
18
+
Raise <parameter>num</parameter> to the power
19
+
<parameter>exponent</parameter>.
20
20
</para>
21
21
</refsect1>
22
22

...
...
@@ -25,18 +25,20 @@
25
25
<para>
26
26
<variablelist>
27
27
<varlistentry>
28
-
<term><parameter>left_operand</parameter></term>
28
+
<term><parameter>num</parameter></term>
29
29
<listitem>
30
30
<para>
31
-
The left operand, as a string.
31
+
The base, as a string.
32
32
</para>
33
33
</listitem>
34
34
</varlistentry>
35
35
<varlistentry>
36
-
<term><parameter>right_operand</parameter></term>
36
+
<term><parameter>exponent</parameter></term>
37
37
<listitem>
38
38
<para>
39
-
The right operand, as a string.
39
+
The exponent, as a string. If the exponent is non-integral, it is truncated.
40
+
The valid range of the exponent is platform specific, but is at least
41
+
<literal>-2147483648</literal> to <literal>2147483647</literal>.
40
42
</para>
41
43
</listitem>
42
44
</varlistentry>
...
...
@@ -52,6 +54,29 @@
52
54
</para>
53
55
</refsect1>
54
56
57
+
<refsect1 role="changelog"><!-- {{{ -->
58
+
&reftitle.changelog;
59
+
<informaltable>
60
+
<tgroup cols="2">
61
+
<thead>
62
+
<row>
63
+
<entry>&Version;</entry>
64
+
<entry>&Description;</entry>
65
+
</row>
66
+
</thead>
67
+
<tbody>
68
+
<row>
69
+
<entry>7.3.0</entry>
70
+
<entry>
71
+
<function>bcpow</function> now returns numbers with the requested scale.
72
+
Formerly, the returned numbers may have omitted trailing decimal zeroes.
73
+
</entry>
74
+
</row>
75
+
</tbody>
76
+
</tgroup>
77
+
</informaltable>
78
+
</refsect1><!-- }}} -->
79
+

55
80
<refsect1 role="examples">
56
81
&reftitle.examples;
57
82
<example>
...
...
@@ -72,7 +97,7 @@ echo bcpow('4.2', '3', 2); // 74.08
72
97
&reftitle.notes;
73
98
<note>
74
99
<para>
75
-
<function>bcpow</function> may return a result with fewer digits after the
100
+
Before PHP 7.3.0 <function>bcpow</function> may return a result with fewer digits after the
76
101
decimal point than the <parameter>scale</parameter> parameter would
77
102
indicate. This only occurs when the result doesn't require all of the
78
103
precision allowed by the <parameter>scale</parameter>. For example:
...
...
@@ -100,7 +125,6 @@ echo bcpow('5', '2', 2); // prints "25", not "25.00"
100
125
</para>
101
126
</refsect1>
102
127
</refentry>
103
-

104
128
<!-- Keep this comment at the end of the file
105
129
Local variables:
106
130
mode: sgml
107
131