Skip to content

Commit d0aea10

Browse files
committed
Fixed and added exception behavior. Also added a literal tag
1 parent 0e48683 commit d0aea10

File tree

12 files changed

+125
-12
lines changed

12 files changed

+125
-12
lines changed

reference/bc/functions/bcadd.xml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,18 @@
5151
The sum of the two operands, as a string.
5252
</para>
5353
</refsect1>
54-
54+
55+
<refsect1 role="errors">
56+
&reftitle.errors;
57+
<para>
58+
This function throws a <exceptionname>ValueError</exceptionname> in the following cases:
59+
<simplelist>
60+
<member><parameter>num1</parameter> or <parameter>num2</parameter> is not a well-formed BCMath numeric string</member>
61+
<member><parameter>scale</parameter> is outside the valid range</member>
62+
</simplelist>
63+
</para>
64+
</refsect1>
65+
5566
<refsect1 role="changelog">
5667
&reftitle.changelog;
5768
<informaltable>

reference/bc/functions/bcceil.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,17 @@
3939
</simpara>
4040
</refsect1>
4141

42+
<refsect1 role="errors">
43+
&reftitle.errors;
44+
<para>
45+
This function throws a <exceptionname>ValueError</exceptionname> in the following cases:
46+
<simplelist>
47+
<member><parameter>num</parameter> is not a well-formed BCMath numeric string</member>
48+
<member><parameter>scale</parameter> is outside the valid range</member>
49+
</simplelist>
50+
</para>
51+
</refsect1>
52+
4253
<refsect1 role="examples">
4354
&reftitle.examples;
4455
<example>

reference/bc/functions/bccomp.xml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,23 @@
5858
<refsect1 role="returnvalues">
5959
&reftitle.returnvalues;
6060
<para>
61-
Returns 0 if the two operands are equal, 1 if the
61+
Returns <literal>0</literal> if the two operands are equal, <literal>1</literal> if the
6262
<parameter>num1</parameter> is larger than the
63-
<parameter>num2</parameter>, -1 otherwise.
63+
<parameter>num2</parameter>, <literal>-1</literal> otherwise.
6464
</para>
6565
</refsect1>
66-
66+
67+
<refsect1 role="errors">
68+
&reftitle.errors;
69+
<para>
70+
This function throws a <exceptionname>ValueError</exceptionname> in the following cases:
71+
<simplelist>
72+
<member><parameter>num1</parameter> or <parameter>num2</parameter> is not a well-formed BCMath numeric string</member>
73+
<member><parameter>scale</parameter> is outside the valid range</member>
74+
</simplelist>
75+
</para>
76+
</refsect1>
77+
6778
<refsect1 role="changelog">
6879
&reftitle.changelog;
6980
<informaltable>

reference/bc/functions/bcdiv.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
<row>
8888
<entry>8.0.0</entry>
8989
<entry>
90-
Dividing by 0 now throws a <exceptionname>DivisionByZeroError</exceptionname> exception instead of returning null.
90+
Dividing by <literal>0</literal> now throws a <exceptionname>DivisionByZeroError</exceptionname> exception instead of returning null.
9191
</entry>
9292
</row>
9393
</tbody>

reference/bc/functions/bcfloor.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,17 @@
3939
</simpara>
4040
</refsect1>
4141

42+
<refsect1 role="errors">
43+
&reftitle.errors;
44+
<para>
45+
This function throws a <exceptionname>ValueError</exceptionname> in the following cases:
46+
<simplelist>
47+
<member><parameter>num</parameter> is not a well-formed BCMath numeric string</member>
48+
<member><parameter>scale</parameter> is outside the valid range</member>
49+
</simplelist>
50+
</para>
51+
</refsect1>
52+
4253
<refsect1 role="examples">
4354
&reftitle.examples;
4455
<example>

reference/bc/functions/bcmod.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
<row>
9090
<entry>8.0.0</entry>
9191
<entry>
92-
Dividing by 0 now throws a <exceptionname>DivisionByZeroError</exceptionname> exception instead of returning null.
92+
Dividing by <literal>0</literal> now throws a <exceptionname>DivisionByZeroError</exceptionname> exception instead of returning null.
9393
</entry>
9494
</row>
9595
<row>

reference/bc/functions/bcmul.xml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,18 @@
5151
Returns the result as a string.
5252
</para>
5353
</refsect1>
54-
54+
55+
<refsect1 role="errors">
56+
&reftitle.errors;
57+
<para>
58+
This function throws a <exceptionname>ValueError</exceptionname> in the following cases:
59+
<simplelist>
60+
<member><parameter>num1</parameter> or <parameter>num2</parameter> is not a well-formed BCMath numeric string</member>
61+
<member><parameter>scale</parameter> is outside the valid range</member>
62+
</simplelist>
63+
</para>
64+
</refsect1>
65+
5566
<refsect1 role="changelog"><!-- {{{ -->
5667
&reftitle.changelog;
5768
<informaltable>

reference/bc/functions/bcpow.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
<row>
8585
<entry>8.4.0</entry>
8686
<entry>
87-
Negative powers of 0 previously returned 0, but now throw a <exceptionname>DivisionByZeroError</exceptionname>
87+
Negative powers of <literal>0</literal> previously returned 0, but now throw a <exceptionname>DivisionByZeroError</exceptionname>
8888
exception.
8989
</entry>
9090
</row>

reference/bc/functions/bcpowmod.xml

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,27 @@
5959
<refsect1 role="returnvalues">
6060
&reftitle.returnvalues;
6161
<para>
62-
Returns the result as a string, or &false; if <parameter>modulus</parameter>
63-
is <literal>0</literal> or <parameter>exponent</parameter> is negative.
62+
Returns the result as a string.
6463
</para>
6564
</refsect1>
6665

66+
<refsect1 role="errors">
67+
&reftitle.errors;
68+
<para>
69+
This function throws a <exceptionname>ValueError</exceptionname> in the following cases:
70+
<simplelist>
71+
<member><parameter>num</parameter>, <parameter>exponent</parameter> or <parameter>modulus</parameter> is not a well-formed BCMath numeric string</member>
72+
<member><parameter>num</parameter>, <parameter>exponent</parameter> or <parameter>modulus</parameter> has a fractional part</member>
73+
<member><parameter>scale</parameter> is outside the valid range</member>
74+
<member><parameter>exponent</parameter> is a negative value</member>
75+
</simplelist>
76+
</para>
77+
<simpara>
78+
This function throws a <exceptionname>DivisionByZeroError</exceptionname> exception if <parameter>modulus</parameter>
79+
is <literal>0</literal>.
80+
</simpara>
81+
</refsect1>
82+
6783
<refsect1 role="changelog">
6884
&reftitle.changelog;
6985
<informaltable>
@@ -81,6 +97,18 @@
8197
<parameter>scale</parameter> is now nullable.
8298
</entry>
8399
</row>
100+
<row>
101+
<entry>8.0.0</entry>
102+
<entry>
103+
Now throws a <exceptionname>ValueError</exceptionname> instead of returning &false; if <parameter>exponent</parameter> is a negative value.
104+
</entry>
105+
</row>
106+
<row>
107+
<entry>8.0.0</entry>
108+
<entry>
109+
Dividing by <literal>0</literal> now throws a <exceptionname>DivisionByZeroError</exceptionname> exception instead of returning &false;.
110+
</entry>
111+
</row>
84112
</tbody>
85113
</tgroup>
86114
</informaltable>

reference/bc/functions/bcround.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,17 @@
4545
</simpara>
4646
</refsect1>
4747

48+
<refsect1 role="errors">
49+
&reftitle.errors;
50+
<para>
51+
This function throws a <exceptionname>ValueError</exceptionname> in the following cases:
52+
<simplelist>
53+
<member><parameter>num</parameter> is not a well-formed BCMath numeric string</member>
54+
<member><parameter>scale</parameter> is outside the valid range</member>
55+
</simplelist>
56+
</para>
57+
</refsect1>
58+
4859
<refsect1 role="examples">
4960
&reftitle.examples;
5061
<example>

reference/bc/functions/bcscale.xml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,15 @@
4747
Returns the old scale when used as setter. Otherwise the current scale is returned.
4848
</para>
4949
</refsect1>
50-
50+
51+
<refsect1 role="errors">
52+
&reftitle.errors;
53+
<simpara>
54+
This function throws a <exceptionname>ValueError</exceptionname> if <parameter>scale</parameter>
55+
is outside the valid range.
56+
</simpara>
57+
</refsect1>
58+
5159
<refsect1 role="changelog">
5260
&reftitle.changelog;
5361
<informaltable>

reference/bc/functions/bcsub.xml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,18 @@
5151
The result of the subtraction, as a string.
5252
</para>
5353
</refsect1>
54-
54+
55+
<refsect1 role="errors">
56+
&reftitle.errors;
57+
<para>
58+
This function throws a <exceptionname>ValueError</exceptionname> in the following cases:
59+
<simplelist>
60+
<member><parameter>num1</parameter> or <parameter>num2</parameter> is not a well-formed BCMath numeric string</member>
61+
<member><parameter>scale</parameter> is outside the valid range</member>
62+
</simplelist>
63+
</para>
64+
</refsect1>
65+
5566
<refsect1 role="changelog">
5667
&reftitle.changelog;
5768
<informaltable>

0 commit comments

Comments
 (0)