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

search for in the

gmp_sqrt> <gmp_setbit
Last updated: Fri, 04 Jul 2008

view this page in

gmp_sign

(PHP 4 >= 4.0.4, PHP 5)

gmp_sign — Obtiene el signo del número

Descripción

int gmp_sign ( resource $a )

Devuelve 1 si a es positivo, -1 si a es negativo y 0 si a es cero.

Example #1 Ejemplo de gmp_sign()

<?php
// positivo
echo gmp_sign("500") . "\n";

// negativo
echo gmp_sign("-500") . "\n";

// cero
echo gmp_sign("0") . "\n";
?>

La salida del anterior programa es:

1
-1
0


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

gmp_sqrt> <gmp_setbit
Last updated: Fri, 04 Jul 2008
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites