note 83631 deleted from language.operators.arithmetic by salathe
| From: | salathe@php.net | Date: | Mon, 21 Sep 2020 14:58:10 +0000 |
| Subject: | note 83631 deleted from language.operators.arithmetic by salathe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-215400@lists.php.net to get a copy of this message | ||
Note Submitter: TheWanderer
----
It is worth noticing that when working with large numbers, most noticably using the modulo operator,
the results depend on your CPU architecture. Therefore, running a decent 64-bit machine will be to
your advantage in case you have to perform complex mathematical operations. Here is some example
code - you can compare its output on x86 and x86_64 machines:
<?php
/* tested under PHP 5.2.6-1 with Suhosin-Patch 0.9.6.2 (cli) on both i386 and amd64, Debian
lenny/sid */
$a = 2863311530;
$b = 256;
$c = $a % $b;
echo "$c <br />\n";
echo (2863311530 % 256)." <br />\n"; /* directly with no variables, just to be sure
*/
?>
The code is expected to produce '170' if working correctly (try it in spreadsheet
software).