reference/bc/functions/bcscale.xml
23f5599c8cc2713e7a4fdc29d8cceab66c341c48
...
...
@@ -3,19 +3,26 @@
3
3
<refentry xml:id="function.bcscale" xmlns="http://docbook.org/ns/docbook">
4
4
<refnamediv>
5
5
<refname>bcscale</refname>
6
-
<refpurpose>Set default scale parameter for all bc math functions</refpurpose>
6
+
<refpurpose>Set or get default scale parameter for all bc math functions</refpurpose>
7
7
</refnamediv>
8
8
9
9
<refsect1 role="description">
10
10
&reftitle.description;
11
11
<methodsynopsis>
12
-
<type>bool</type><methodname>bcscale</methodname>
12
+
<type>int</type><methodname>bcscale</methodname>
13
13
<methodparam><type>int</type><parameter>scale</parameter></methodparam>
14
14
</methodsynopsis>
15
15
<para>
16
16
Sets the default scale parameter for all subsequent calls to bc math functions that
17
17
do not explicitly specify a scale parameter.
18
18
</para>
19
+
<methodsynopsis>
20
+
<type>int</type><methodname>bcscale</methodname>
21
+
<methodparam choice="opt"><type>null</type><parameter>scale</parameter><initializer>&null;</initializer></methodparam>
22
+
</methodsynopsis>
23
+
<para>
24
+
Gets the current scale factor.
25
+
</para>
19
26
</refsect1>
20
27

21
28
<refsect1 role="parameters">
...
...
@@ -37,10 +44,41 @@
37
44
<refsect1 role="returnvalues">
38
45
&reftitle.returnvalues;
39
46
<para>
40
-
&return.success;
47
+
Returns the old scale when used as setter. Otherwise the current scale is returned.
41
48
</para>
42
49
</refsect1>
43
50
51
+
<refsect1 role="changelog">
52
+
&reftitle.changelog;
53
+
<informaltable>
54
+
<tgroup cols="2">
55
+
<thead>
56
+
<row>
57
+
<entry>&Version;</entry>
58
+
<entry>&Description;</entry>
59
+
</row>
60
+
</thead>
61
+
<tbody>
62
+
<row>
63
+
<entry>8.0.0</entry>
64
+
<entry>
65
+
<parameter>scale</parameter> is now nullable.
66
+
</entry>
67
+
</row>
68
+
<row>
69
+
<entry>7.3.0</entry>
70
+
<entry>
71
+
<function>bcscale</function> can now be used to get the current scale
72
+
factor; when used as setter, it now returns the old scale value.
73
+
Formerly, <parameter>scale</parameter> was mandatory, and
74
+
<function>bcscale</function> always returned &true;.
75
+
</entry>
76
+
</row>
77
+
</tbody>
78
+
</tgroup>
79
+
</informaltable>
80
+
</refsect1>
81
+

44
82
<refsect1 role="examples">
45
83
&reftitle.examples;
46
84
<para>
...
...
@@ -64,7 +102,6 @@ echo bcdiv('105', '6.55957', 3); // 16.007
64
102
</para>
65
103
</refsect1>
66
104
</refentry>
67
-

68
105
<!-- Keep this comment at the end of the file
69
106
Local variables:
70
107
mode: sgml
71
108