reference/bc/functions/bcmul.xml
23f5599c8cc2713e7a4fdc29d8cceab66c341c48
...
...
@@ -10,13 +10,13 @@
10
10
&reftitle.description;
11
11
<methodsynopsis>
12
12
<type>string</type><methodname>bcmul</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>num1</parameter></methodparam>
14
+
<methodparam><type>string</type><parameter>num2</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
-
Multiply the <parameter>left_operand</parameter> by the
19
-
<parameter>right_operand</parameter>.
18
+
Multiply the <parameter>num1</parameter> by the
19
+
<parameter>num2</parameter>.
20
20
</para>
21
21
</refsect1>
22
22

...
...
@@ -25,7 +25,7 @@
25
25
<para>
26
26
<variablelist>
27
27
<varlistentry>
28
-
<term><parameter>left_operand</parameter></term>
28
+
<term><parameter>num1</parameter></term>
29
29
<listitem>
30
30
<para>
31
31
The left operand, as a string.
...
...
@@ -33,7 +33,7 @@
33
33
</listitem>
34
34
</varlistentry>
35
35
<varlistentry>
36
-
<term><parameter>right_operand</parameter></term>
36
+
<term><parameter>num2</parameter></term>
37
37
<listitem>
38
38
<para>
39
39
The right operand, as a string.
...
...
@@ -52,6 +52,35 @@
52
52
</para>
53
53
</refsect1>
54
54
55
+
<refsect1 role="changelog"><!-- {{{ -->
56
+
&reftitle.changelog;
57
+
<informaltable>
58
+
<tgroup cols="2">
59
+
<thead>
60
+
<row>
61
+
<entry>&Version;</entry>
62
+
<entry>&Description;</entry>
63
+
</row>
64
+
</thead>
65
+
<tbody>
66
+
<row>
67
+
<entry>8.0.0</entry>
68
+
<entry>
69
+
<parameter>scale</parameter> is now nullable.
70
+
</entry>
71
+
</row>
72
+
<row>
73
+
<entry>7.3.0</entry>
74
+
<entry>
75
+
<function>bcmul</function> now returns numbers with the requested scale.
76
+
Formerly, the returned numbers may have omitted trailing decimal zeroes.
77
+
</entry>
78
+
</row>
79
+
</tbody>
80
+
</tgroup>
81
+
</informaltable>
82
+
</refsect1><!-- }}} -->
83
+

55
84
<refsect1 role="examples">
56
85
&reftitle.examples;
57
86
<example>
...
...
@@ -67,6 +96,28 @@ echo bcmul('2', '4'); // 8
67
96
</example>
68
97
</refsect1>
69
98
99
+
<refsect1 role="notes">
100
+
&reftitle.notes;
101
+
<note>
102
+
<para>
103
+
Before PHP 7.3.0 <function>bcmul</function> may return a result with fewer digits after the
104
+
decimal point than the <parameter>scale</parameter> parameter would
105
+
indicate. This only occurs when the result doesn't require all of the
106
+
precision allowed by the <parameter>scale</parameter>. For example:
107
+
<example>
108
+
<title><function>bcmul</function> scale example</title>
109
+
<programlisting role="php">
110
+
<![CDATA[
111
+
<?php
112
+
echo bcmul('5', '2', 2); // prints "10", not "10.00"
113
+
?>
114
+
]]>
115
+
</programlisting>
116
+
</example>
117
+
</para>
118
+
</note>
119
+
</refsect1>
120
+
70
121
<refsect1 role="seealso">
71
122
&reftitle.seealso;
72
123
<para>
...
...
@@ -76,7 +127,6 @@ echo bcmul('2', '4'); // 8
76
127
</para>
77
128
</refsect1>
78
129
</refentry>
79
-

80
130
<!-- Keep this comment at the end of the file
81
131
Local variables:
82
132
mode: sgml
83
133