reference/bc/functions/bcpowmod.xml
cbac1ecf71d754707d69bdc344c4031c157eaa54
...
...
@@ -10,15 +10,15 @@
10
10
&reftitle.description;
11
11
<methodsynopsis>
12
12
<type>string</type><methodname>bcpowmod</methodname>
13
-
<methodparam><type>string</type><parameter>left_operand</parameter></methodparam>
14
-
<methodparam><type>string</type><parameter>right_operand</parameter></methodparam>
13
+
<methodparam><type>string</type><parameter>num</parameter></methodparam>
14
+
<methodparam><type>string</type><parameter>exponent</parameter></methodparam>
15
15
<methodparam><type>string</type><parameter>modulus</parameter></methodparam>
16
-
<methodparam choice="opt"><type>int</type><parameter>scale</parameter><initializer>0</initializer></methodparam>
16
+
<methodparam choice="opt"><type class="union"><type>int</type><type>null</type></type><parameter>scale</parameter><initializer>&null;</initializer></methodparam>
17
17
</methodsynopsis>
18
18
<para>
19
19
Use the fast-exponentiation method to raise
20
-
<parameter>left_operand</parameter> to the power
21
-
<parameter>right_operand</parameter> with respect to the modulus
20
+
<parameter>num</parameter> to the power
21
+
<parameter>exponent</parameter> with respect to the modulus
22
22
<parameter>modulus</parameter>.
23
23
</para>
24
24
</refsect1>
...
...
@@ -28,18 +28,18 @@
28
28
<para>
29
29
<variablelist>
30
30
<varlistentry>
31
-
<term><parameter>left_operand</parameter></term>
31
+
<term><parameter>num</parameter></term>
32
32
<listitem>
33
33
<para>
34
-
The left operand, as a string.
34
+
The base, as an integral string (i.e. the scale has to be zero).
35
35
</para>
36
36
</listitem>
37
37
</varlistentry>
38
38
<varlistentry>
39
-
<term><parameter>right_operand</parameter></term>
39
+
<term><parameter>exponent</parameter></term>
40
40
<listitem>
41
41
<para>
42
-
The right operand, as a string.
42
+
The exponent, as an non-negative, integral string (i.e. the scale has to be zero).
43
43
</para>
44
44
</listitem>
45
45
</varlistentry>
...
...
@@ -47,7 +47,7 @@
47
47
<term><parameter>modulus</parameter></term>
48
48
<listitem>
49
49
<para>
50
-
The modulus, as a string.
50
+
The modulus, as an integral string (i.e. the scale has to be zero).
51
51
</para>
52
52
</listitem>
53
53
</varlistentry>
...
...
@@ -59,19 +59,31 @@
59
59
<refsect1 role="returnvalues">
60
60
&reftitle.returnvalues;
61
61
<para>
62
-
Returns the result as a string, or &null; if <parameter>modulus</parameter>
63
-
is 0.
62
+
Returns the result as a string, or &false; if <parameter>modulus</parameter>
63
+
is <literal>0</literal> or <parameter>exponent</parameter> is negative.
64
64
</para>
65
65
</refsect1>
66
66

67
-
<refsect1 role="notes">
68
-
&reftitle.notes;
69
-
<note>
70
-
<para>
71
-
Because this method uses the modulus operation, numbers which are not
72
-
positive integers may give unexpected results.
73
-
</para>
74
-
</note>
67
+
<refsect1 role="changelog">
68
+
&reftitle.changelog;
69
+
<informaltable>
70
+
<tgroup cols="2">
71
+
<thead>
72
+
<row>
73
+
<entry>&Version;</entry>
74
+
<entry>&Description;</entry>
75
+
</row>
76
+
</thead>
77
+
<tbody>
78
+
<row>
79
+
<entry>8.0.0</entry>
80
+
<entry>
81
+
<parameter>scale</parameter> is now nullable.
82
+
</entry>
83
+
</row>
84
+
</tbody>
85
+
</tgroup>
86
+
</informaltable>
75
87
</refsect1>
76
88

77
89
<refsect1 role="examples">
...
...
@@ -97,6 +109,16 @@ $b = bcmod(bcpow($x, $y), $mod);
97
109
</para>
98
110
</refsect1>
99
111

112
+
<refsect1 role="notes">
113
+
&reftitle.notes;
114
+
<note>
115
+
<para>
116
+
Because this method uses the modulus operation, numbers which are not
117
+
positive integers may give unexpected results.
118
+
</para>
119
+
</note>
120
+
</refsect1>
121
+

100
122
<refsect1 role="seealso">
101
123
&reftitle.seealso;
102
124
<para>
...
...
@@ -107,7 +129,6 @@ $b = bcmod(bcpow($x, $y), $mod);
107
129
</para>
108
130
</refsect1>
109
131
</refentry>
110
-

111
132
<!-- Keep this comment at the end of the file
112
133
Local variables:
113
134
mode: sgml
114
135