reference/gmp/book.xml
a35fce69cc4174f61cfa228ad677797c833f9cba
...
...
@@ -1,9 +1,8 @@
1
1
<?xml version="1.0" encoding="utf-8"?>
2
2
<!-- $Revision$ -->
3
-
<!-- Purpose: mathcrypto.math -->
4
-
<!-- Membership: bundled, external -->
5
3
6
4
<book xml:id="book.gmp" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
5
+
<?phpdoc extension-membership="bundledexternal" ?>
7
6
<title>GNU Multiple Precision</title>
8
7
<titleabbrev>GMP</titleabbrev>
9
8
...
...
@@ -11,37 +10,39 @@
11
10
<preface xml:id="intro.gmp">
12
11
&reftitle.intro;
13
12
<simpara>
14
-
These functions allow you to work with arbitrary-length integers
15
-
using the GNU <acronym>MP</acronym> library.
16
-
</simpara>
17
-
<simpara>
18
-
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.
19
15
</simpara>
20
16
<note>
21
17
<para>
22
-
Most GMP functions accept GMP number arguments, defined as
23
-
<literal>resource</literal> below. However, most of these
24
-
functions will also accept numeric and string arguments, given
25
-
that it is possible to convert the latter to a number. Also,
26
-
if there is a faster function that can operate on integer arguments,
27
-
it would be used instead of the slower function when the supplied arguments are
28
-
integers. This is done transparently, so the bottom line is that
29
-
you can use integers in every function that expects GMP
30
-
number. See also the <function>gmp_init</function> function.
18
+
Most GMP functions accept GMP number arguments. These are shown in this
19
+
documentation as <classname>GMP</classname> objects. Most
20
+
of these functions will also accept numeric and string arguments, so long
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
24
+
<function>gmp_init</function> function.
25
+
</para>
26
+
</note>
27
+
<note>
28
+
<para>
29
+
From PHP 5.6 onwards, the
30
+
<link linkend="language.operators.arithmetic">arithmetic</link>,
31
+
<link linkend="language.operators.bitwise">bitwise</link>, and
32
+
<link linkend="language.operators.comparison">comparison</link> operators
33
+
may be used with the <classname>GMP</classname> objects returned from
34
+
<function>gmp_init</function> and other GMP functions.
31
35
</para>
32
36
</note>
33
37
<warning>
34
38
<simpara>
35
-
If you want to explicitly specify a large integer,
36
-
specify it as a string. If you don't do that, PHP will
37
-
interpret the integer-literal first, possibly resulting
38
-
in loss of precision, even before <literal>GMP</literal>
39
-
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.
40
41
</simpara>
41
42
</warning>
42
43
<note>
43
44
<simpara>
44
-
This extension is available on Windows platforms since PHP 5.1.0.
45
+
This extension is available on Windows platforms.
45
46
</simpara>
46
47
</note>
47
48
</preface>
...
...
@@ -51,6 +52,7 @@
51
52
&reference.gmp.constants;
52
53
&reference.gmp.examples;
53
54
&reference.gmp.reference;
55
+
&reference.gmp.gmp;
54
56

55
57
</book>
56
58

57
59