gmp_sign(3) php man page | unix.com

Man Page: gmp_sign

Operating Environment: php

Section: 3

GMP_SIGN(3)								 1							       GMP_SIGN(3)

gmp_sign - Sign of number

SYNOPSIS
int gmp_sign (GMP $a)
DESCRIPTION
Checks the sign of a number.
PARAMETERS
o $a -Either a GMP number resource in PHP 5.5 and earlier, a GMP object in PHP 5.6 and later, or a numeric string provided that it is possible to convert the latter to a number.
RETURN VALUES
Returns 1 if $a is positive, -1 if $a is negative, and 0 if $a is zero.
EXAMPLES
Example #1 gmp_sign(3) example <?php // positive echo gmp_sign("500") . " "; // negative echo gmp_sign("-500") . " "; // zero echo gmp_sign("0") . " "; ?> The above example will output: 1 -1 0
SEE ALSO
gmp_abs(3), abs(3). PHP Documentation Group GMP_SIGN(3)
Related Man Pages
gmp_clrbit(3) - php
gmp_div_q(3) - php
pow(3) - php
substr_compare(3) - php
dateinterval.format(3) - php
Similar Topics in the Unix Linux Community
UNIX.COM 2017 Year End Summary
New Code Tags (Syntax Highlighting)
Please Welcome Don Cragun as Lead Moderator
Status of UNIX.COM Forum Transformation
Please Welcome Ravinder Singh to the Moderation Team