2002-04-15 00:12:54 +00:00
|
|
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
2004-02-08 08:46:23 +00:00
|
|
|
<!-- $Revision: 1.3 $ -->
|
2002-04-15 00:12:54 +00:00
|
|
|
<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 -->
|
|
|
|
<refentry id="function.gmp-cmp">
|
|
|
|
<refnamediv>
|
|
|
|
<refname>gmp_cmp</refname>
|
|
|
|
<refpurpose>Compare numbers</refpurpose>
|
|
|
|
</refnamediv>
|
|
|
|
<refsect1>
|
|
|
|
<title>Description</title>
|
|
|
|
<methodsynopsis>
|
|
|
|
<type>int</type><methodname>gmp_cmp</methodname>
|
|
|
|
<methodparam><type>resource</type><parameter>a</parameter></methodparam>
|
|
|
|
<methodparam><type>resource</type><parameter>b</parameter></methodparam>
|
|
|
|
</methodsynopsis>
|
|
|
|
<para>
|
2004-02-08 08:46:23 +00:00
|
|
|
Returns a positive value if <literal>a > b</literal>, zero if
|
|
|
|
<literal>a = b</literal> and a negative value if <literal>a <
|
2002-04-15 00:12:54 +00:00
|
|
|
b</literal>.
|
|
|
|
</para>
|
2004-02-08 08:46:23 +00:00
|
|
|
<example>
|
|
|
|
<title><function>gmp_cmp</function> example</title>
|
|
|
|
<programlisting role="php">
|
|
|
|
<![CDATA[
|
|
|
|
<?php
|
|
|
|
$cmp1 = gmp_cmp("1234", "1000"); // greater than
|
|
|
|
$cmp2 = gmp_cmp("1000", "1234"); // less than
|
|
|
|
$cmp3 = gmp_cmp("1234", "1234"); // equal to
|
|
|
|
|
|
|
|
echo "$cmp1 $cmp2 $cmp3\n";
|
|
|
|
?>
|
|
|
|
]]>
|
|
|
|
</programlisting>
|
|
|
|
<para>
|
|
|
|
The printout of the above program will be:
|
|
|
|
</para>
|
|
|
|
<screen>
|
|
|
|
<![CDATA[
|
|
|
|
1 -1 0
|
|
|
|
]]>
|
|
|
|
</screen>
|
|
|
|
</example>
|
2002-04-15 00:12:54 +00:00
|
|
|
</refsect1>
|
|
|
|
</refentry>
|
|
|
|
|
|
|
|
<!-- 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
|
|
|
|
sgml-default-dtd-file:"../../../../manual.ced"
|
|
|
|
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
|
|
|
|
-->
|