Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
PHP: gmp_hamdist - Manual
[go: Go Back, main page]

PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

gmp_init" width="11" height="7"/> <gmp_gcdext
Last updated: Mon, 05 Feb 2007

view this page in

gmp_hamdist

(PHP 4 >= 4.0.4, PHP 5)

gmp_hamdist — ハミング距離

説明

int gmp_hamdist ( resource a, resource b )

ab の間の ハミング距離を返します。オペランドは共に非負とする必要があります。

例 737. gmp_hamdist() の例

<?php
$ham1
= gmp_init("1001010011", 2);
$ham2 = gmp_init("1011111100", 2);
echo
gmp_hamdist($ham1, $ham2) . "\n";

/* ハミング距離は、以下と等しくなります */
echo gmp_popcount(gmp_xor($ham1, $ham2)) . "\n";
?>

上のプログラムの出力は以下のようになります。


6
6

     

gmp_popcount()gmp_xor() も参照ください。



add a note add a note User Contributed Notes
gmp_hamdist
There are no user contributed notes for this page.

gmp_init" width="11" height="7"/> <gmp_gcdext
Last updated: Mon, 05 Feb 2007
 
 
show source | credits | sitemap | contact | advertising | mirror sites