Warning: Use of undefined constant DOCUMENT_ROOT - assumed 'DOCUMENT_ROOT' (this will throw an Error in a future version of PHP) in /home/vhosts/podolsk.xp3.biz/1.php on line 1

Warning: Use of undefined constant DOCUMENT_ROOT - assumed 'DOCUMENT_ROOT' (this will throw an Error in a future version of PHP) in /home/vhosts/podolsk.xp3.biz/0.php on line 1
PHP. Руководство по PHP. 2005 (создание и продвижение сайта)
создание и продвижение сайта (вбиваю в ТОП-10, как гвозди)Настройка и сопровождение платной рекламы яндекс.директ

PHP. Руководство по PHP. 2005

gmp_hamdist

Пред.

След.

gmp_hamdist

(PHP 4>= 4.0.4, PHP 5)gmp_hamdist -- Hamming distance

Description

int gmp_hamdist (resource a, resource b)

Returns the hamming distance between a and b. Both operands should be non-negative.

Пример 1. gmp_hamdist() example

<?php

$ham1 = gmp_init("1001010011", 2);

$ham2 = gmp_init("10100", 2);

echo gmp_hamdist($ham1, $ham2) . "\n";

/* hamdist is equivilent to: */

echo gmp_popcount(gmp_xor($ham1, $ham2)) . "\n";

?>

The printout of the above program will be:
6

6

See also gmp_popcount(), gmp_xor()

Пред.

Начало

След.

gmp_gcdext

Уровень выше

gmp_init

Отвечу на любые вопросы. С уважением, Дмитрий Владимирович.

Ваше письмо×
Free Web Hosting