% always return int?
| From: | Christian Dechery | Date: | Fri, 04 May 2001 00:33:36 +0000 |
| Subject: | % always return int? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-51353@lists.php.net to get a copy of this message | ||
How can I get the modulus of an float by an integer?
$time=3.345345;
$time2=2.34234;
$time3=$time%$time2;
echo $time3;
this outputs 1.
$time=3.345345;
$time2=2
$time3=$time%$time2;
echo $time3;
this also outputs 1.
Of course... when dividing two floats, there is no remainder... but, there is an integer invovled... is automatically converted to float before dividing, so that's why no remainder?
____________________________
. Christian Dechery (lemming)
. http://www.tanamesa.com.br
. Gaita-L Owner / Web Developer