note 126273 added to function.gmp-cmp
| From: | vadym dot masiuk at gmail dot com | Date: | Sun, 25 Jul 2021 23:14:34 +0000 |
| Subject: | note 126273 added to function.gmp-cmp | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-216657@lists.php.net to get a copy of this message | ||
In some cases it will return 2 and -2, depend on provided values, if only 1 argument is negative,
for example:
<?php
$cmp1 = gmp_cmp("1234", "-1000"); // greater than
$cmp2 = gmp_cmp("-1000", "1234"); // less than
$cmp3 = gmp_cmp("-1234", "1000"); // less than
$cmp4 = gmp_cmp("1000", "-1234"); // greater than
echo "$cmp1 $cmp2 $cmp3 $cmp4\n";
?>
The above example will output: 2 -2 -2 2
----
Server IP: 45.112.84.4
Probable Submitter: 45.112.85.242 (proxied: 2.49.148.196)
----
Manual Page -- https://php.net/manual/en/function.gmp-cmp.php
Edit -- https://main.php.net/note/edit/126273
Del: integrated -- https://main.php.net/note/delete/126273/integrated
Del: useless -- https://main.php.net/note/delete/126273/useless
Del: bad code -- https://main.php.net/note/delete/126273/bad+code
Del: spam -- https://main.php.net/note/delete/126273/spam
Del: non-english -- https://main.php.net/note/delete/126273/non-english
Del: in docs -- https://main.php.net/note/delete/126273/in+docs
Del: other reasons-- https://main.php.net/note/delete/126273
Reject -- https://main.php.net/note/reject/126273
Search -- https://main.php.net/manage/user-notes.php