PHP 4.0 Bug #6400: division operator "/" does not perform integer division
| From: | tobias at langhammer dot com | Date: | Mon, 28 Aug 2000 14:07:51 +0000 |
| Subject: | PHP 4.0 Bug #6400: division operator "/" does not perform integer division | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-30959@lists.php.net to get a copy of this message | ||
From: tobias@langhammer.com
Operating system: Linux version 2.4.0-test5
PHP version: 4.0.1pl2
PHP Bug Type: Documentation problem
Bug description: division operator "/" does not perform integer division
In the following script the operator "/" does NOT perform an integer division as said in
the documentation:
In chapter "Arithmetic Operators" the online documentation sais: "The division
operator ("/") returns an integer value (the result of an integer division) if the two
operands are integers (or strings that get converted to integers)."
Though the script
<?php echo "1 / 3 = ". 1/3 ?>
produces the following output:
1 / 3 = 0.33333333333333