File tree Expand file tree Collapse file tree 7 files changed +23
-15
lines changed Expand file tree Collapse file tree 7 files changed +23
-15
lines changed Original file line number Diff line number Diff line change 32
32
<term ><parameter >scale</parameter ></term >
33
33
<listitem >
34
34
<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.
37
37
</simpara >
38
38
</listitem >
39
39
</varlistentry >
Original file line number Diff line number Diff line change 24
24
<listitem >
25
25
<simpara >
26
26
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 >,
28
28
the <property >BcMath\Number::scale</property > is always set to <literal >0</literal >.
29
29
If <parameter >num</parameter > is a <type >string</type >, it must be a valid number,
30
30
and the <property >BcMath\Number::scale</property > is automatically set by parsing the string.
Original file line number Diff line number Diff line change 49
49
<literal >15</literal >.
50
50
</simpara >
51
51
<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 >.
59
59
</simpara >
60
60
</refsect1 >
61
61
Original file line number Diff line number Diff line change 43
43
</simpara >
44
44
</refsect1 >
45
45
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
+
46
53
<refsect1 role =" examples" >
47
54
&reftitle.examples;
48
55
<example >
Original file line number Diff line number Diff line change 30
30
</simpara >
31
31
<simpara >
32
32
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
34
34
as indivisible division, the <property >BcMath\Number::scale</property > of the result is expanded.
35
35
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.
36
37
</simpara >
37
38
<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 >,
39
40
the <property >BcMath\Number::scale</property > of the result is between <literal >5</literal > and
40
41
<literal >15</literal >.
41
42
</simpara >
46
47
<para >
47
48
This method throws a <exceptionname >ValueError</exceptionname > in the following cases:
48
49
<simplelist >
49
- <member >This object is a negative value</member >
50
+ <member >< varname >$this</ varname > is a negative value</member >
50
51
<member ><parameter >scale</parameter > is outside the valid range</member >
51
52
<member ><property >BcMath\Number::scale</property > of the result object is outside the valid range</member >
52
53
</simplelist >
Original file line number Diff line number Diff line change 84
84
<row >
85
85
<entry >8.4.0</entry >
86
86
<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 >
88
88
exception.
89
89
</entry >
90
90
</row >
Original file line number Diff line number Diff line change 51
51
This function throws a <exceptionname >ValueError</exceptionname > in the following cases:
52
52
<simplelist >
53
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 >
54
+ <member >An invalid <parameter >mode </parameter > is specified .</member >
55
55
</simplelist >
56
56
</para >
57
57
</refsect1 >
You can’t perform that action at this time.
0 commit comments