[Gllug] OT: algorithm needed
salsaman at xs4all.nl
salsaman at xs4all.nl
Sun Aug 10 21:44:54 UTC 2008
On Sun, August 10, 2008 22:49, Ben Whyte wrote:
>
>> Cant you do this by taking the total and dividing it by the max which
>> gives you the number of times that the max goes into the total, then
>> divide the total by this number which will give you equal number of
>> blocks.
>>
>> Wouldnt that give you what you want ?
>>
>> Ben
>
> Really must read what i type properly. You need to round the total/max
> up to the next whole number before dividing total by it.
>
> Ben
> --
> Gllug mailing list - Gllug at gllug.org.uk
> http://lists.gllug.org.uk/mailman/listinfo/gllug
>
>
Yes I think that is along the right lines:
ceil (100/45) = 3;
100/3 = 33, remainder 1.
First read is 33+remainder = 34, next reads are 33.
I knew I was missing something obvious !
Thanks for your help.
Gabriel.
--
Gllug mailing list - Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug
More information about the GLLUG
mailing list