2002-04-15 00:12:54 +00:00
|
|
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
2009-07-11 07:11:53 +00:00
|
|
|
<!-- $Revision$ -->
|
2007-06-20 22:25:43 +00:00
|
|
|
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.gmp-init">
|
2007-06-18 23:13:23 +00:00
|
|
|
<refnamediv>
|
|
|
|
<refname>gmp_init</refname>
|
|
|
|
<refpurpose>Create GMP number</refpurpose>
|
|
|
|
</refnamediv>
|
2007-07-21 04:19:32 +00:00
|
|
|
|
|
|
|
<refsect1 role="description">
|
|
|
|
&reftitle.description;
|
2007-06-18 23:13:23 +00:00
|
|
|
<methodsynopsis>
|
|
|
|
<type>resource</type><methodname>gmp_init</methodname>
|
|
|
|
<methodparam><type>mixed</type><parameter>number</parameter></methodparam>
|
2009-01-12 15:45:03 +00:00
|
|
|
<methodparam choice="opt"><type>int</type><parameter>base</parameter><initializer>0</initializer></methodparam>
|
2007-06-18 23:13:23 +00:00
|
|
|
</methodsynopsis>
|
|
|
|
<para>
|
2007-07-21 04:19:32 +00:00
|
|
|
Creates a GMP number from an integer or string.
|
2007-06-18 23:13:23 +00:00
|
|
|
</para>
|
2007-07-21 04:19:32 +00:00
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="parameters">
|
|
|
|
&reftitle.parameters;
|
2007-06-18 23:13:23 +00:00
|
|
|
<para>
|
2007-07-21 04:19:32 +00:00
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
|
|
|
<term><parameter>number</parameter></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
An integer or a string. The string representation can be decimal,
|
|
|
|
hexadecimal or octal.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
|
|
<term><parameter>base</parameter></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
The base. Defaults to 0.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
The base may vary from 2 to 36. If base is 0 (default value), the
|
|
|
|
actual base is determined from the leading characters: if the first
|
|
|
|
two characters are <literal>0x</literal> or <literal>0X</literal>,
|
|
|
|
hexadecimal is assumed, otherwise if the first character is "0",
|
|
|
|
octal is assumed, otherwise decimal is assumed.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
2007-06-18 23:13:23 +00:00
|
|
|
</para>
|
2007-07-21 04:19:32 +00:00
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="returnvalues">
|
|
|
|
&reftitle.returnvalues;
|
|
|
|
<para>
|
|
|
|
&gmp.return;
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="changelog">
|
|
|
|
&reftitle.changelog;
|
|
|
|
<para>
|
|
|
|
<informaltable>
|
|
|
|
<tgroup cols="2">
|
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>&Version;</entry>
|
|
|
|
<entry>&Description;</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<row>
|
|
|
|
<entry>4.1.0</entry>
|
|
|
|
<entry>
|
|
|
|
The optional <parameter>base</parameter> parameter was added.
|
|
|
|
</entry>
|
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</informaltable>
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="examples">
|
|
|
|
&reftitle.examples;
|
2007-06-18 23:13:23 +00:00
|
|
|
<para>
|
|
|
|
<example>
|
|
|
|
<title>Creating GMP number</title>
|
|
|
|
<programlisting role="php">
|
2002-04-15 00:12:54 +00:00
|
|
|
<![CDATA[
|
|
|
|
<?php
|
2004-02-26 11:14:11 +00:00
|
|
|
$a = gmp_init(123456);
|
|
|
|
$b = gmp_init("0xFFFFDEBACDFEDF7200");
|
2002-04-15 00:12:54 +00:00
|
|
|
?>
|
|
|
|
]]>
|
2007-06-18 23:13:23 +00:00
|
|
|
</programlisting>
|
|
|
|
</example>
|
|
|
|
</para>
|
2007-07-21 04:19:32 +00:00
|
|
|
</refsect1>
|
2002-04-15 00:12:54 +00:00
|
|
|
|
2007-07-21 04:19:32 +00:00
|
|
|
<refsect1 role="notes">
|
|
|
|
&reftitle.notes;
|
2007-06-18 23:13:23 +00:00
|
|
|
<note>
|
|
|
|
<para>
|
|
|
|
It is not necessary to call this function if you want to use
|
|
|
|
integer or string in place of GMP number in GMP functions, like
|
|
|
|
<function>gmp_add</function>. Function arguments are
|
|
|
|
automatically converted to GMP numbers, if such conversion is
|
|
|
|
possible and needed, using the same rules as
|
|
|
|
<function>gmp_init</function>.
|
|
|
|
</para>
|
|
|
|
</note>
|
|
|
|
</refsect1>
|
2007-07-21 04:19:32 +00:00
|
|
|
|
2007-06-18 23:13:23 +00:00
|
|
|
</refentry>
|
2002-04-15 00:12:54 +00:00
|
|
|
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
|
|
Local variables:
|
|
|
|
mode: sgml
|
|
|
|
sgml-omittag:t
|
|
|
|
sgml-shorttag:t
|
|
|
|
sgml-minimize-attributes:nil
|
|
|
|
sgml-always-quote-attributes:t
|
|
|
|
sgml-indent-step:1
|
|
|
|
sgml-indent-data:t
|
|
|
|
indent-tabs-mode:nil
|
|
|
|
sgml-parent-document:nil
|
2009-09-25 07:04:39 +00:00
|
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
2002-04-15 00:12:54 +00:00
|
|
|
sgml-exposed-tags:nil
|
|
|
|
sgml-local-catalogs:nil
|
|
|
|
sgml-local-ecat-files:nil
|
|
|
|
End:
|
|
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
|
|
vim: et tw=78 syn=sgml
|
|
|
|
vi: ts=1 sw=1
|
|
|
|
-->
|