Re: Math Question....
| From: | Jo�o C�ndido de Souza Neto | Date: | Thu, 22 Apr 2010 14:40:42 +0000 |
| Subject: | Re: Math Question.... | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-304425@lists.php.net to get a copy of this message | ||
I´ll try this again:
for ($g = $maxpergroup; $g > 0; $g--) {
if ($items mod $g <> 0) continue;
$Groups = $items div $g;
break;
}
Hope it helps.
""João Cândido de Souza Neto"" <joao@consultorweb.cnt.br> escreveu na
mensagem news:05.36.21218.06D50DB4@pb1.pair.com...
>I think today is not may day to write. hehehe
>
> sorry.
> ""João Cândido de Souza Neto"" <joao@consultorweb.cnt.br> escreveu
> na
> mensagem news:12.B5.21218.F0D50DB4@pb1.pair.com...
>> there´s an error in the forget the former:
>>
>> for ($g = $maxpergroup; $g > 0; $g--) {
>> if ($items mod $g <> 0) continue;
>> $Groups = $items div $g;
>> }
>>
>>
>> ""João Cândido de Souza Neto"" <joao@consultorweb.cnt.br>
>> escreveu na
>> mensagem news:87.84.21218.63C50DB4@pb1.pair.com...
>>> for ($g = $maxpergroup; $g > 0; $g++) {
>>> if ($items mod $g <> 0) continue;
>>> $Groups = $items div $g;
>>> }
>>>
>>> Maybe it can helps you.
>>>
>>> "Dan Joseph" <dmjoseph@gmail.com> escreveu na mensagem
>>>
>>> news:q2oa20394491004220707x980cef5ej2b310c97d123056b@mail.gmail.com...
>>>> Howdy,
>>>>
>>>> This is a math question, but I'm doing the code in PHP, and have
>>>> expunged
>>>> all resources... hoping someone can guide me here. For some reason, I
>>>> can't
>>>> figure this out.
>>>>
>>>> I want to take a group of items, and divide them into equal groups
>>>> based on
>>>> a max per group. Example.
>>>>
>>>> 1,252,398 -- divide into equal groups with only 30 items per group max.
>>>>
>>>> Can anyone guide me towards an algorithm or formula name to solve this?
>>>> PHP
>>>> code or Math stuff is fine. Either way...
>>>>
>>>> Thanks...
>>>>
>>>> --
>>>> -Dan Joseph
>>>>
>>>> www.canishosting.com - Unlimited Hosting Plans start @ $3.95/month.
>>>> Promo
>>>> Code "NEWTHINGS" for 10% off initial order
>>>>
>>>> http://www.facebook.com/canishosting
>>>> http://www.facebook.com/originalpoetry
>>>>
>>>
>>>
>>
>>
>
>