note 49849 added to language.types.type-juggling
| From: | Raja at osu1 dot php dot net | Date: | Thu, 10 Feb 2005 11:05:17 +0000 |
| Subject: | note 49849 added to language.types.type-juggling | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-84785@lists.php.net to get a copy of this message | ||
Uneven division of an integer variable by another integer variable will result in a float by
automatic conversion -- you do not have to cast the variables to floats in order to avoid integer
truncation (as you would in C, for example):
$dividend = 2;
$divisor = 3;
$quotient = $dividend/$divisor;
print $quotient; // 0.66666666666667
----
Manual Page -- http://www.php.net/manual/en/language.types.type-juggling.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+49849
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+49849&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+49849&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+49849&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+49849&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+49849&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+49849&report=yes
Search -- http://master.php.net/manage/user-notes.php