Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[PHP-DOC] cvs: phpdoc /en/functions gmp.xml

0 views
Skip to first unread message

Jeroen van Wolffelaar

unread,
May 16, 2001, 11:27:53 AM5/16/01
to
jeroen Wed May 16 08:27:52 2001 EDT

Modified files:
/phpdoc/en/functions gmp.xml
Log:
Added warning to gmp_init



Index: phpdoc/en/functions/gmp.xml
diff -u phpdoc/en/functions/gmp.xml:1.7 phpdoc/en/functions/gmp.xml:1.8
--- phpdoc/en/functions/gmp.xml:1.7 Thu Mar 8 02:47:17 2001
+++ phpdoc/en/functions/gmp.xml Wed May 16 08:27:52 2001
@@ -86,6 +86,25 @@
</programlisting>
</example>
</para>
+
+ <warning>
+ <para>
+ If you want to explicitely specify an integer, do not use
+ <literal>gmp_init(12378473895798475827348979342)</literal>,
+ since first the integer-literal will be interpreted,
+ resulting in an
+ <link linkend="language.types.integer.overflow">overflow</link>
+ and thus in zero, and then gmp_init is called with that
+ zero as argument.
+ <!-- TODO: wrong, it will be converted to float (type-jug), which
+ will lead to loss of precision. -->
+ </para>
+ <simpara>
+ Instead, use
+ <literal>gmp_init('12378473895798475827348979342')</literal>
+ </simpara>
+ </warning>
+
<note>
<para>
It is not necessary to call this function if you want to use

Egon Schmid

unread,
May 17, 2001, 1:56:34 AM5/17/01
to
eschmid Wed May 16 22:56:33 2001 EDT

Modified files:
/phpdoc/en/functions gmp.xml
Log:

To make the story short. I deleded that crap.

Index: phpdoc/en/functions/gmp.xml
diff -u phpdoc/en/functions/gmp.xml:1.8 phpdoc/en/functions/gmp.xml:1.9
--- phpdoc/en/functions/gmp.xml:1.8 Wed May 16 08:27:52 2001
+++ phpdoc/en/functions/gmp.xml Wed May 16 22:56:33 2001
@@ -93,9 +93,11 @@
<literal>gmp_init(12378473895798475827348979342)</literal>,


since first the integer-literal will be interpreted,

resulting in an
+<!--


<link linkend="language.types.integer.overflow">overflow</link>

and thus in zero, and then gmp_init is called with that

zero as argument.
+-->


<!-- TODO: wrong, it will be converted to float (type-jug), which

will lead to loss of precision. -->

</para>

Jeroen van Wolffelaar

unread,
May 17, 2001, 10:06:34 AM5/17/01
to
jeroen Thu May 17 07:06:31 2001 EDT

Modified files:
/phpdoc/en/functions gmp.xml
Log:

Corrected the 'crap', moved it to frontpage



Index: phpdoc/en/functions/gmp.xml
diff -u phpdoc/en/functions/gmp.xml:1.9 phpdoc/en/functions/gmp.xml:1.10
--- phpdoc/en/functions/gmp.xml:1.9 Wed May 16 22:56:33 2001
+++ phpdoc/en/functions/gmp.xml Thu May 17 07:06:31 2001
@@ -34,6 +34,17 @@
number. See also the <function>gmp_init</function> function.
</para>
</note>
+
+ <warning>
+ <simpara>
+ If you want to explicitely specify a large integer,
+ specify it as a string. If you don't do that, PHP will
+ interpret the integer-literal first, possibly resulting
+ in loss of precision, even before <literal>GMP</literal>
+ comes into play.


+ </simpara>
+ </warning>
+

<para>
<example>
<title>Factorial function using GMP</title>
@@ -87,26 +98,6 @@
</example>
</para>

- <warning>
- <para>
- If you want to explicitely specify an integer, do not use
- <literal>gmp_init(12378473895798475827348979342)</literal>,
- since first the integer-literal will be interpreted,
- resulting in an
-<!--
- <link linkend="language.types.integer.overflow">overflow</link>
- and thus in zero, and then gmp_init is called with that
- zero as argument.
--->
- <!-- TODO: wrong, it will be converted to float (type-jug), which
- will lead to loss of precision. -->
- </para>
- <simpara>
- Instead, use
- <literal>gmp_init('12378473895798475827348979342')</literal>
- </simpara>
- </warning>
-

0 new messages