reference/bc/functions/bccomp.xml
c7e83fbbbcde9f54affc09424d032c38492a3ff4
...
...
@@ -1,6 +1,6 @@
1
1
<?xml version="1.0" encoding="utf-8"?>
2
2
<!-- $Revision$ -->
3
-
<refentry xml:id="function.bccomp" xmlns="http://docbook.org/ns/docbook">
3
+
<refentry xml:id="function.bccomp" xmlns="http://docbook.org/ns/docbook" xmlns:xi="http://www.w3.org/2001/XInclude">
4
4
<refnamediv>
5
5
<refname>bccomp</refname>
6
6
<refpurpose>Compare two arbitrary precision numbers</refpurpose>
...
...
@@ -10,58 +10,51 @@
10
10
&reftitle.description;
11
11
<methodsynopsis>
12
12
<type>int</type><methodname>bccomp</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
-
Compares the <parameter>left_operand</parameter> to the
19
-
<parameter>right_operand</parameter> and returns the result as an
20
-
integer.
18
+
Compares <parameter>num1</parameter> to <parameter>num2</parameter>
19
+
and returns the result of the comparison as an integer.
21
20
</para>
22
21
</refsect1>
23
22

24
23
<refsect1 role="parameters">
25
-
&reftitle.parameters;
26
-
<para>
27
-
<variablelist>
28
-
<varlistentry>
29
-
<term><parameter>left_operand</parameter></term>
30
-
<listitem>
31
-
<para>
32
-
The left operand, as a string.
33
-
</para>
34
-
</listitem>
35
-
</varlistentry>
36
-
<varlistentry>
37
-
<term><parameter>right_operand</parameter></term>
38
-
<listitem>
39
-
<para>
40
-
The right operand, as a string.
41
-
</para>
42
-
</listitem>
43
-
</varlistentry>
44
-
<varlistentry>
45
-
<term><parameter>scale</parameter></term>
46
-
<listitem>
47
-
<para>
48
-
The optional <parameter>scale</parameter> parameter is used to set the
49
-
number of digits after the decimal place which will be used in the
50
-
comparison.
51
-
</para>
52
-
</listitem>
53
-
</varlistentry>
54
-
</variablelist>
55
-
</para>
24
+
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('function.bcadd')/db:refsect1[@role='parameters']/*)" />
56
25
</refsect1>
57
26

58
27
<refsect1 role="returnvalues">
59
28
&reftitle.returnvalues;
60
-
<para>
61
-
Returns 0 if the two operands are equal, 1 if the
62
-
<parameter>left_operand</parameter> is larger than the
63
-
<parameter>right_operand</parameter>, -1 otherwise.
64
-
</para>
29
+
<simpara>
30
+
Returns <literal>0</literal> if both operands are equal,
31
+
<literal>1</literal> if <parameter>num1</parameter> is greater than
32
+
<parameter>num2</parameter>, <literal>-1</literal> otherwise.
33
+
</simpara>
34
+
</refsect1>
35
+

36
+
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('function.bcadd')/db:refsect1[@role='errors'])" />
37
+

38
+
<refsect1 role="changelog">
39
+
&reftitle.changelog;
40
+
<informaltable>
41
+
<tgroup cols="2">
42
+
<thead>
43
+
<row>
44
+
<entry>&Version;</entry>
45
+
<entry>&Description;</entry>
46
+
</row>
47
+
</thead>
48
+
<tbody>
49
+
<row>
50
+
<entry>8.0.0</entry>
51
+
<entry>
52
+
<parameter>scale</parameter> is now nullable.
53
+
</entry>
54
+
</row>
55
+
</tbody>
56
+
</tgroup>
57
+
</informaltable>
65
58
</refsect1>
66
59

67
60
<refsect1 role="examples">
...
...
@@ -81,8 +74,14 @@ echo bccomp('1.00001', '1', 5); // 1
81
74
</programlisting>
82
75
</example>
83
76
</refsect1>
84
-
</refentry>
85
77

78
+
<refsect1 role="seealso">
79
+
&reftitle.seealso;
80
+
<simplelist>
81
+
<member><methodname>BcMath\Number::compare</methodname></member>
82
+
</simplelist>
83
+
</refsect1>
84
+
</refentry>
86
85
<!-- Keep this comment at the end of the file
87
86
Local variables:
88
87
mode: sgml
89
88