ID: 14244 User updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Bogus Bug Type: Variables related Operating System: linux PHP Version: 4.0.6 New Comment:
Bug Database <[EMAIL PROTECTED]> Did you see my program?,and dir you run them? obviously, the two operands are ***integers ***. Previous Comments: ------------------------------------------------------------------------ [2001-11-27 01:16:50] [EMAIL PROTECTED] 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] [EMAIL PROTECTED] 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 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]