Bug #14244 Updated: A bug about integer operation "/"
| From: | poolshark at bmcc dot com dot cn | Date: | Tue, 27 Nov 2001 07:17:50 +0000 |
| Subject: | Bug #14244 Updated: A bug about integer operation "/" | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-71747@lists.php.net to get a copy of this message | ||
ID: 14244
User updated by: poolshark@bmcc.com.cn
Reported By: poolshark@bmcc.com.cn
Status: Bogus
Bug Type: Variables related
Operating System: linux
PHP Version: 4.0.6
New Comment:
Bug Database <php-dev@lists.php.net>
Did you see my program?,and dir you run them?
obviously, the two operands are ***integers ***.
Previous Comments:
------------------------------------------------------------------------
[2001-11-27 01:16:50] cnewbill@php.net
RTM http://www.php.net/manual/en/language.operators.php
"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) and the
quotient is an integer. ****If either operand is a floating-point value, or the operation results in
a non-integer value, a floating-point value is returned.****"
-Chris
------------------------------------------------------------------------
[2001-11-27 01:06:51] poolshark@bmcc.com.cn
Here is a short test program :
<?
#test.php of integer operation by /
$total=13;
printf ("total %d type %s<BR>",$total,gettype($total));
$each=10;
printf ("each %d type %s<BR>",$each,gettype($each));
$page=$total/$each;
print ("Page is $page");
?>
The output is 1.3
not as the expect 1
-----------------------------
configure command
./configure --with-apache=/home/zlq/bin/apache_1.3.22
--with-mysql=/mysql
--with-xml
--with-charset=gb2312
--disable-debug
--enable-ftp
-------------------------------
INIT_VERSION :sysinit-2.78
HOSTTYPE:i386
------------------------------------------------------------------------
Edit this bug report at http://bugs.php.net/?id=14244&edit=1