On Tuesday 12 August 2003 10:27 am, Doug Thompson wrote:
> The "%" is called the Modulus operator. It is very briefly explained in
> the PHP manual in table 11-2.
>
> In your example, $mod = $a % $b ==> $mod = 0.8
The modulus is the remainder after division hence 5 into 24 goes 3 times with
a re
Although now that I look at:
http://us4.php.net/manual/en/language.operators.arithmetic.php
You'll see that $a % $b resturns the modulus so that is probably the easiest.
Andrew,
At 11:43 AM 8/12/2003, you wrote:
There's probably a better way to do this, but to retrieve only the 0.8 from
24/5 t
The easiest way would probably be to use the fmod function.
http://us3.php.net/manual/en/function.fmod.php
Andrew.
At 11:43 AM 8/12/2003, Matthew Moldvan wrote:
There's probably a better way to do this, but to retrieve only the 0.8 from
24/5 try this:
($a/$b)-floor($a/$b)
Regards,
Matt.
-O
The "%" is called the Modulus operator. It is very briefly explained in the PHP
manual in table 11-2.
In your example, $mod = $a % $b ==> $mod = 0.8
It is a very easy operator to use.
Doug
On Tue, 12 Aug 2003 11:04:39 +0200, Alain Barthélemy wrote:
>Hello,
>
>If you have
>
>$a = 24;
>$b =
On Tuesday 12 August 2003 10:39 am, Phil Driscoll wrote:
> The modulus is the remainder after division hence 5 into 24 goes 3 times
> with a remainder of 4,
oops - 4 times with a remainder of 4 :(
--
Phil Driscoll
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http:
There's probably a better way to do this, but to retrieve only the 0.8 from
24/5 try this:
($a/$b)-floor($a/$b)
Regards,
Matt.
-Original Message-
From: Alain Barthélemy [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 12, 2003 5:05 AM
To: php-db
Subject: [PHP-DB] % operator
Hello,
If y
thing to do with databases. :)
Regards,
Matt.
-Original Message-
From: Andrew D. Luebke [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 12, 2003 3:04 PM
To: 'Alain Barthélemy'; php-db
Subject: RE: [PHP-DB] % operator
Although now that I look at:
http://us4.ph
One day I'll learn to wait until two cups of coffee before attempting to post replies.
On top of which, I have no idea where "0.8" came from. 8-/
Sorry for the confusion factor.
Doug
On Tue, 12 Aug 2003 10:47:21 +0100, Phil Driscoll wrote:
>On Tuesday 12 August 2003 10:39 am, Phil Driscoll