Rapide Advanced Adulte
 
 Web|Image|Shop|Video|News|Wmx|Mobile|Wiki|Ajouter ce moteur

     Manuel PHP     
Partager
 
 
Partager
Partager

 

Table :

.gmp abs
.gmp add
.gmp and
.gmp clrbit
.gmp cmp
.gmp com
.gmp div q
.gmp div qr
.gmp div r
.gmp div
.gmp div q()
.gmp divexact
.gmp fact
.gmp gcd
.gmp gcdext
.gmp hamdist
.gmp init
.gmp intval
.gmp invert
.gmp jacobi
.gmp legendre
.gmp mod
.gmp mul
.gmp neg
.gmp nextprime
.gmp or
.gmp perfect square
.gmp popcount
.gmp pow
.gmp powm
.gmp prob prime
.gmp random
.gmp scan0
.gmp scan1
.gmp setbit
.gmp sign
.gmp sqrt
.gmp sqrtrem
.gmp strval
.gmp sub
.gmp xor
 
   

  gmp_hamdist  


gmp_hamdist

(PHP 4 >= 4.0.4, PHP 5)

gmp_hamdist -- Distance de Hamming

Description

int gmp_hamdist ( resource a, resource b )

gmp_hamdist() retourne la distance de Hamming entre a et b. Les deux paramètres doivent être strictement positifs.

Exemple 1. Exemple avec gmp_hamdist()

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

/* hamdist est équivalent à : */
echo gmp_popcount(gmp_xor($ham1, $ham2)) . "\n";
?>

L'exemple ci-dessus va afficher :

6
6

Voir aussi gmp_popcount() et gmp_xor().


    Annonces       
 

 Retour au chapitre Php

 

Top
 

Ajouter JungleKey.fr à votre Explorateur

 
 

About Us | © 2007 JungleKey




iBlack | Mobile | Wiki | Ajouter ce moteur
.