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

search for in the

gmp_popcount> <gmp_or
[edit] Last updated: Fri, 24 May 2013

view this page in

gmp_perfect_square

(PHP 4 >= 4.0.4, PHP 5)

gmp_perfect_squareCarré parfait GMP

Description

bool gmp_perfect_square ( resource $a )

Vérifie si a est un carré parfait.

Liste de paramètres

a

Le nombre à vérifier.

Il peut être soit une ressource GMP, soit une chaîne numérique qu'il est possible de convertir plus tard en un nombre.

Valeurs de retour

Retourne TRUE si a est un carré parfait, FALSE sinon.

Exemples

Exemple #1 Exemple avec gmp_perfect_square()

<?php
// 3 * 3, carré parfait
var_dump(gmp_perfect_square("9"));

// pas un carré parfait
var_dump(gmp_perfect_square("7"));

// 1234567890 * 1234567890, carré parfait
var_dump(gmp_perfect_square("1524157875019052100"));
?>

L'exemple ci-dessus va afficher :

bool(true)
bool(false)
bool(true)

Voir aussi



add a note add a note User Contributed Notes gmp_perfect_square - [0 notes]
There are no user contributed notes for this page.

 
show source | credits | sitemap | contact | advertising | mirror sites