reference/gmp/book.xml
a35fce69cc4174f61cfa228ad677797c833f9cba
...
...
@@ -10,48 +10,39 @@
10
10
<preface xml:id="intro.gmp">
11
11
&reftitle.intro;
12
12
<simpara>
13
-
These functions allow you to work with arbitrary-length integers
14
-
using the GNU <acronym>MP</acronym> library.
15
-
</simpara>
16
-
<simpara>
17
-
These functions have been added in PHP 4.0.4.
13
+
These functions allow for arbitrary-length integers to be worked with using
14
+
the GNU <acronym>MP</acronym> library.
18
15
</simpara>
19
16
<note>
20
17
<para>
21
18
Most GMP functions accept GMP number arguments. These are shown in this
22
-
documentation as <classname>GMP</classname> objects; however note that PHP
23
-
5.5 and earlier represented GMP numbers as <type>resource</type>s. Most
19
+
documentation as <classname>GMP</classname> objects. Most
24
20
of these functions will also accept numeric and string arguments, so long
25
-
as it is possible to convert the latter to a number. Also, if there is a
26
-
faster function that can operate on integer arguments, it would be used
27
-
instead of the slower function when the supplied arguments are integers.
28
-
This is done transparently, so the bottom line is that you can use
29
-
integers in every function that expects GMP number. See also the
21
+
as it is possible to convert the latter to a number. Also, if there is a
22
+
more performant function that can operate on the arguments (integers only),
23
+
then it will be used instead (this is done transparently). See also the
30
24
<function>gmp_init</function> function.
31
25
</para>
32
26
</note>
33
27
<note>
34
28
<para>
35
-
From PHP 5.6 onwards, you can use
29
+
From PHP 5.6 onwards, the
36
30
<link linkend="language.operators.arithmetic">arithmetic</link>,
37
-
<link linkend="language.operators.bitwise">bitwise</link> and
31
+
<link linkend="language.operators.bitwise">bitwise</link>, and
38
32
<link linkend="language.operators.comparison">comparison</link> operators
39
-
with the <classname>GMP</classname> objects returned from
33
+
may be used with the <classname>GMP</classname> objects returned from
40
34
<function>gmp_init</function> and other GMP functions.
41
35
</para>
42
36
</note>
43
37
<warning>
44
38
<simpara>
45
-
If you want to explicitly specify a large integer,
46
-
specify it as a string. If you don't do that, PHP will
47
-
interpret the integer-literal first, possibly resulting
48
-
in loss of precision, even before <literal>GMP</literal>
49
-
comes into play.
39
+
Large integers must be specified as strings - otherwise, PHP will coerce
40
+
them to floats, resulting in a loss of precision.
50
41
</simpara>
51
42
</warning>
52
43
<note>
53
44
<simpara>
54
-
This extension is available on Windows platforms since PHP 5.1.0.
45
+
This extension is available on Windows platforms.
55
46
</simpara>
56
47
</note>
57
48
</preface>
58
49