Podręcznik PHP






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.

Przykład 1. gmp_hamdist() example

<?php
$ham1
= gmp_init("1001010011", 2);
$ham2 = gmp_init("1011111100", 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()



zamki polskie


print 'gadżety reklamowe warszawa 1171501899' . "\n"; print 'program do faktur 1171501915' . "\n"; print 'Kotły CO 1171501580' . "\n"; print 'program do księgowości 1171501917' . "\n"; print 'Link 4 1171501654' . "\n";