Skip to content

Commit a414ee9

Browse files
ext/bcmath: Minor fixes (#4422)
1 parent e6e9c11 commit a414ee9

File tree

7 files changed

+23
-15
lines changed

7 files changed

+23
-15
lines changed

reference/bc/bcmath/number/add.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
<term><parameter>scale</parameter></term>
3333
<listitem>
3434
<simpara>
35-
<parameter>scale</parameter> explicitly specified for calculation results.
36-
If &null;, the <parameter>scale</parameter> of the calculation result will be set automatically.
35+
<property>BcMath\Number::scale</property> explicitly specified for calculation results.
36+
If &null;, the <property>BcMath\Number::scale</property> of the calculation result will be set automatically.
3737
</simpara>
3838
</listitem>
3939
</varlistentry>

reference/bc/bcmath/number/construct.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<listitem>
2525
<simpara>
2626
An <type>int</type> or <type>string</type> value.
27-
If <parameter>num</parameter> is a <type>int</type>,
27+
If <parameter>num</parameter> is a <type>int</type>,
2828
the <property>BcMath\Number::scale</property> is always set to <literal>0</literal>.
2929
If <parameter>num</parameter> is a <type>string</type>, it must be a valid number,
3030
and the <property>BcMath\Number::scale</property> is automatically set by parsing the string.

reference/bc/bcmath/number/div.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@
4949
<literal>15</literal>.
5050
</simpara>
5151
<simpara>
52-
Even in indivisible calculations, the <property>BcMath\Number::scale</property> will not always be
53-
<literal>+10</literal>.
54-
A <literal>0</literal> at the end of the result is considered not to need expansion, so the
55-
<property>BcMath\Number::scale</property> is reduced by that amount.
56-
The <property>BcMath\Number::scale</property> will never be less than the
57-
<property>BcMath\Number::scale</property> before expansion.
58-
See also the <link linkend="bcmath-number.div.example.expansion-scale">code example</link>.
52+
Even in indivisible calculations, the <property>BcMath\Number::scale</property> will not always be
53+
<literal>+10</literal>.
54+
A <literal>0</literal> at the end of the result is considered not to need expansion, so the
55+
<property>BcMath\Number::scale</property> is reduced by that amount.
56+
The <property>BcMath\Number::scale</property> will never be less than the
57+
<property>BcMath\Number::scale</property> before expansion.
58+
See also the <link linkend="bcmath-number.div.example.expansion-scale">code example</link>.
5959
</simpara>
6060
</refsect1>
6161

reference/bc/bcmath/number/round.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@
4343
</simpara>
4444
</refsect1>
4545

46+
<refsect1 role="errors">
47+
&reftitle.errors;
48+
<simpara>
49+
This method throws a <exceptionname>ValueError</exceptionname> if an invalid <parameter>mode</parameter> is specified.
50+
</simpara>
51+
</refsect1>
52+
4653
<refsect1 role="examples">
4754
&reftitle.examples;
4855
<example>

reference/bc/bcmath/number/sqrt.xml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,13 @@
3030
</simpara>
3131
<simpara>
3232
When the <property>BcMath\Number::scale</property> of the result object is automatically set,
33-
the <property>BcMath\Number::scale</property> of this object is used. However, in cases such
33+
the <property>BcMath\Number::scale</property> of <varname>$this</varname> is used. However, in cases such
3434
as indivisible division, the <property>BcMath\Number::scale</property> of the result is expanded.
3535
Expansion is done only as needed, up to a maximum of <literal>+10</literal>.
36+
This behavior is the same as <methodname>BcMath\Number::div</methodname>, so please see that for details.
3637
</simpara>
3738
<simpara>
38-
That is, if the <property>BcMath\Number::scale</property> of this object is <literal>5</literal>,
39+
That is, if the <property>BcMath\Number::scale</property> of <varname>$this</varname> is <literal>5</literal>,
3940
the <property>BcMath\Number::scale</property> of the result is between <literal>5</literal> and
4041
<literal>15</literal>.
4142
</simpara>
@@ -46,7 +47,7 @@
4647
<para>
4748
This method throws a <exceptionname>ValueError</exceptionname> in the following cases:
4849
<simplelist>
49-
<member>This object is a negative value</member>
50+
<member><varname>$this</varname> is a negative value</member>
5051
<member><parameter>scale</parameter> is outside the valid range</member>
5152
<member><property>BcMath\Number::scale</property> of the result object is outside the valid range</member>
5253
</simplelist>

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 <literal>0</literal> previously returned 0, but now throw a <exceptionname>DivisionByZeroError</exceptionname>
87+
Negative powers of <literal>0</literal> previously returned <literal>0</literal>, but now throw a <exceptionname>DivisionByZeroError</exceptionname>
8888
exception.
8989
</entry>
9090
</row>

reference/bc/functions/bcround.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
This function throws a <exceptionname>ValueError</exceptionname> in the following cases:
5252
<simplelist>
5353
<member><parameter>num</parameter> is not a well-formed BCMath numeric string.</member>
54-
<member><parameter>scale</parameter> is outside the valid range.</member>
54+
<member>An invalid <parameter>mode</parameter> is specified.</member>
5555
</simplelist>
5656
</para>
5757
</refsect1>

0 commit comments

Comments
 (0)