2002-04-15 00:12:54 +00:00
|
|
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
2004-02-26 11:14:11 +00:00
|
|
|
<!-- $Revision: 1.5 $ -->
|
2002-04-15 00:12:54 +00:00
|
|
|
<!-- splitted from ./en/functions/gmp.xml, last change in rev 1.1 -->
|
|
|
|
<refentry id="function.gmp-xor">
|
|
|
|
<refnamediv>
|
|
|
|
<refname>gmp_xor</refname>
|
|
|
|
<refpurpose>Logical XOR</refpurpose>
|
|
|
|
</refnamediv>
|
|
|
|
<refsect1>
|
|
|
|
<title>Description</title>
|
|
|
|
<methodsynopsis>
|
|
|
|
<type>resource</type><methodname>gmp_xor</methodname>
|
|
|
|
<methodparam><type>resource</type><parameter>a</parameter></methodparam>
|
|
|
|
<methodparam><type>resource</type><parameter>b</parameter></methodparam>
|
|
|
|
</methodsynopsis>
|
|
|
|
<para>
|
|
|
|
Calculates logical exclusive OR (XOR) of two GMP numbers.
|
|
|
|
</para>
|
2004-02-08 08:46:23 +00:00
|
|
|
<example>
|
|
|
|
<title><function>gmp_xor</function> example</title>
|
|
|
|
<programlisting role="php">
|
|
|
|
<![CDATA[
|
2004-02-09 03:32:36 +00:00
|
|
|
<?php
|
2004-02-26 11:14:11 +00:00
|
|
|
$xor1 = gmp_init("1101101110011101", 2);
|
|
|
|
$xor2 = gmp_init("0110011001011001", 2);
|
2004-02-08 08:46:23 +00:00
|
|
|
|
2004-02-26 11:14:11 +00:00
|
|
|
$xor3 = gmp_xor($xor1, $xor2);
|
2004-02-08 08:46:23 +00:00
|
|
|
|
2004-02-26 11:14:11 +00:00
|
|
|
echo gmp_strval($xor3, 2) . "\n";
|
2004-02-08 08:46:23 +00:00
|
|
|
?>
|
|
|
|
]]>
|
|
|
|
</programlisting>
|
|
|
|
<para>
|
|
|
|
The printout of the above program will be:
|
|
|
|
</para>
|
|
|
|
<screen>
|
|
|
|
<![CDATA[
|
|
|
|
1011110111000100
|
|
|
|
]]>
|
|
|
|
</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
|
|
|
|
-->
|