note 47301 rejected from function.gmp-mod by betz
| From: | betz@php.net | Date: | Wed, 10 Nov 2004 18:55:48 +0000 |
| Subject: | note 47301 rejected from function.gmp-mod by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-80364@lists.php.net to get a copy of this message | ||
Note Submitter: Jason dot NOSPAM dot Gagnon at foxmail dot marist dot edu
----
No offense, but that's not a very good example. A beginning programmer who is unsure on how to
use the modulo operation could be confused as to whether the returned value is how many times d goes
into n or the remainder of d divided by n. Using 8 mod 3 doesn't help, as three goes into
eight 2 times with a remainder of 2.
A better example is:
<?php
$mod = gmp_mod("9", "2");
echo gmp_strval($mod) . "\n";
?>
which will output:
1