Re: [PHP] Math Question....

2010-04-23 Thread Richard Quadling
Supply a value and an optional maximum group size. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Math Question....

2010-04-23 Thread tedd
At 10:17 AM -0400 4/22/10, Dan Joseph wrote: On Thu, Apr 22, 2010 at 10:12 AM, Stephen wrote: 1,252,398 DIV 30 = 41,746 groups of 30. 1,252,398 MOD 30 = 18 items in last group Well, the only problem with going that route, is the one group is not equally sized to the others. 18 is ok for

Re: [PHP] Math Question....

2010-04-23 Thread Richard Quadling
On 23 April 2010 13:33, Dotan Cohen wrote: > What is wrong with 626,299 groups of 2 items each (done in my head, so > I might be off a little)? 2, 3, 6, 7, 14 and 21 are all valid. -- - Richard Quadling "Standing on the shoulders of some very clever giants!" EE : http://www.experts-exchang

Re: [PHP] Math Question....

2010-04-23 Thread Dotan Cohen
On 22 April 2010 17:07, Dan Joseph wrote: > 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

Re: [PHP] Math Question....

2010-04-23 Thread Richard Quadling
On 22 April 2010 17:47, Developer Team wrote: > Awesome source. > Thanks > > On 4/22/10, Richard Quadling wrote: >> On 22 April 2010 14:48, Dan Joseph wrote: >>> On Thu, Apr 22, 2010 at 10:29 AM, Richard Quadling >>> >>> wrote: >>>  > > It sounds like you are looking for factors.

Re: [PHP] Math Question....

2010-04-22 Thread Dan Joseph
On Thu, Apr 22, 2010 at 12:16 PM, Richard Quadling wrote: > On 22 April 2010 14:48, Dan Joseph wrote: > This seems to be working ... > > function findBestFactors($Value, $GroupSize, array &$Factors = null) >{ >$Factors = array(); >foreach(range(1, ceil(sqrt($Value))) as

Re: [PHP] Math Question....

2010-04-22 Thread Richard Quadling
On 22 April 2010 14:48, Dan Joseph wrote: > On Thu, Apr 22, 2010 at 10:29 AM, Richard Quadling > wrote: > >>  > >> > It sounds like you are looking for factors. >> > >> > >> http://www.algebra.com/algebra/homework/divisibility/factor-any-number-1.solver >> > >> > Solution by Find factors of any n

Re: [PHP] Math Question....

2010-04-22 Thread Peter van der Does
On Thu, 22 Apr 2010 10:49:11 -0400 Peter van der Does wrote: > > My take on it: > > $Items=1252398; > $MaxInGroup=30; > for ($x=$MaxInGroup; $x>1;$x--) { > $remainder=$Items % $x; > // Change 17 to the max amount allowed in the last group > if ($remainder == 0 || $remainder >

Re: [PHP] Math Question....

2010-04-22 Thread Peter van der Does
On Thu, 22 Apr 2010 10:17:10 -0400 Dan Joseph wrote: > On Thu, Apr 22, 2010 at 10:12 AM, Stephen > wrote: > > > 1,252,398 DIV 30 = 41,746 groups of 30. > > > > 1,252,398 MOD 30 = 18 items in last group > > > Well, the only problem with going that route, is the one group is not > equally sized t

Re: [PHP] Math Question....

2010-04-22 Thread Dan Joseph
On Thu, Apr 22, 2010 at 10:29 AM, Richard Quadling wrote: > > > > It sounds like you are looking for factors. > > > > > http://www.algebra.com/algebra/homework/divisibility/factor-any-number-1.solver > > > > Solution by Find factors of any number > > > > 1252398 is NOT a prime number: 1252398 =

RE: [PHP] Math Question....

2010-04-22 Thread Jason
-Original Message- From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk] Sent: 22 April 2010 15:13 To: Dan Joseph Cc: PHP eMail List Subject: Re: [PHP] Math Question On Thu, 2010-04-22 at 10:17 -0400, Dan Joseph wrote: > On Thu, Apr 22, 2010 at 10:12 AM, Stephen wr

Re: [PHP] Math Question....

2010-04-22 Thread Richard Quadling
On 22 April 2010 15:26, Richard Quadling wrote: > On 22 April 2010 15:13, Ashley Sheridan wrote: >> On Thu, 2010-04-22 at 10:17 -0400, Dan Joseph wrote: >> >>> On Thu, Apr 22, 2010 at 10:12 AM, Stephen wrote: >>> >>> > 1,252,398 DIV 30 = 41,746 groups of 30. >>> > >>> > 1,252,398 MOD 30 = 18 ite

Re: [PHP] Math Question....

2010-04-22 Thread Richard Quadling
On 22 April 2010 15:13, Ashley Sheridan wrote: > On Thu, 2010-04-22 at 10:17 -0400, Dan Joseph wrote: > >> On Thu, Apr 22, 2010 at 10:12 AM, Stephen wrote: >> >> > 1,252,398 DIV 30 = 41,746 groups of 30. >> > >> > 1,252,398 MOD 30 = 18 items in last group >> > >> Well, the only problem with going

Re: [PHP] Math Question....

2010-04-22 Thread Ashley Sheridan
On Thu, 2010-04-22 at 10:17 -0400, Dan Joseph wrote: > On Thu, Apr 22, 2010 at 10:12 AM, Stephen wrote: > > > 1,252,398 DIV 30 = 41,746 groups of 30. > > > > 1,252,398 MOD 30 = 18 items in last group > > > Well, the only problem with going that route, is the one group is not > equally sized to t

Re: [PHP] Math Question....

2010-04-22 Thread Dan Joseph
On Thu, Apr 22, 2010 at 10:12 AM, Stephen wrote: > 1,252,398 DIV 30 = 41,746 groups of 30. > > 1,252,398 MOD 30 = 18 items in last group > Well, the only problem with going that route, is the one group is not equally sized to the others. 18 is ok for a group in this instance, but if it was a rem

Re: [PHP] Math Question....

2010-04-22 Thread Stephen
Dan Joseph wrote: 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. 1,252,398 DIV 30 = 41,746 groups of 30. 1,252,398 MOD 30 = 18 items in last group Stephen --

[PHP] Math Question....

2010-04-22 Thread Dan Joseph
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 -- divid

Re: [PHP] Math Question

2004-02-11 Thread John Nichel
Jeremy Schroeder wrote: Hey group Is there a function that when you divide 2 numbers you drop the remainder and are left with the whole number. A whole section of the manual dedicated to mathematical functions! http://us4.php.net/manual/en/ref.math.php floor() ceil() round() -- By-Tor.com It'

Re: [PHP] Math Question

2004-02-11 Thread Jeremy Schroeder
number. Still seems floor() to me Vincent -Original Message- From: Richard Davey [mailto:[EMAIL PROTECTED] Sent: woensdag 11 februari 2004 15:23 To: Vincent Jansen Cc: [EMAIL PROTECTED] Subject: Re[2]: [PHP] Math Question Hello Vincent, Wednesday, February 11, 2004, 2:15:15 PM, you wrot

RE: Re[2]: [PHP] Math Question

2004-02-11 Thread Vincent Jansen
TECTED] Sent: woensdag 11 februari 2004 15:23 To: Vincent Jansen Cc: [EMAIL PROTECTED] Subject: Re[2]: [PHP] Math Question Hello Vincent, Wednesday, February 11, 2004, 2:15:15 PM, you wrote: VJ> Seems to me you need VJ> floor($number1 / $number2) Only if you always want to round *down*

RE: Re[2]: [PHP] Math Question

2004-02-11 Thread Jay Blanchard
[snip] VJ> Seems to me you need VJ> floor($number1 / $number2) Only if you always want to round *down* the equation. For example flooring a result of 4.99 will give you an integer of 4 whereas round() (or ceil()) will give you 5. It depends on the situation as to which is most useful. [/snip] yo

Re[2]: [PHP] Math Question

2004-02-11 Thread Richard Davey
Hello Vincent, Wednesday, February 11, 2004, 2:15:15 PM, you wrote: VJ> Seems to me you need VJ> floor($number1 / $number2) Only if you always want to round *down* the equation. For example flooring a result of 4.99 will give you an integer of 4 whereas round() (or ceil()) will give you 5. It d

RE: [PHP] Math Question

2004-02-11 Thread Vincent Jansen
Seems to me you need floor($number1 / $number2) Vincent -Original Message- From: Richard Davey [mailto:[EMAIL PROTECTED] Sent: woensdag 11 februari 2004 15:07 To: Jeremy Schroeder Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Math Question Hello Jeremy, Wednesday, February 11, 2004, 2

Re: [PHP] Math Question

2004-02-11 Thread Richard Davey
Hello Jeremy, Wednesday, February 11, 2004, 2:00:32 PM, you wrote: JS> Is there a function that when you divide 2 numbers you drop the JS> remainder and are left with the whole number. round($number1 / $number2) See the manual for the precision value if you need it. -- Best regards, Richard

[PHP] Math Question

2004-02-11 Thread Jeremy Schroeder
Hey group Is there a function that when you divide 2 numbers you drop the remainder and are left with the whole number. -- Blake -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: PHP Math Question

2003-12-11 Thread Eric Bolikowski
kowski" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Thursday, December 11, 2003 5:22 PM Subject: RE: [PHP] Re: PHP Math Question | I do not know if I understand well, but what about | | $group=$number % 4; | if ($group==0) $group=4; | | Brona | | > -Original Message-

Re: [PHP] Re: PHP Math Question

2003-12-11 Thread Rob Bryant
"Mike D" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] I'm am completely stumped on a seemingly simple math formula I need to find a way to map a set of numbers up to 4 (e.g. 1,2,3,4 or 1,2) to any number in a range of up to 10,000 (ideally, unlimited). Such that, (e.g. 1,2,3,4)

Re: [PHP] Re: PHP Math Question

2003-12-11 Thread Website Managers.net
t;\n"; } print $i." is to ".$j."\n"; } // end for ?> Jim - Original Message - From: "Bronislav Klučka" <[EMAIL PROTECTED]> To: "Eric Bolikowski" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Thursday, December 11, 200

RE: [PHP] Re: PHP Math Question

2003-12-11 Thread Bronislav Klučka
I do not know if I understand well, but what about $group=$number % 4; if ($group==0) $group=4; Brona > -Original Message- > From: Eric Bolikowski [mailto:[EMAIL PROTECTED] > Sent: Thursday, December 11, 2003 10:53 PM > To: [EMAIL PROTECTED] > Subject: [PHP] Re: PH

[PHP] Re: PHP Math Question

2003-12-11 Thread Eric Bolikowski
"Mike D" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I'm am completely stumped on a seemingly simple math formula > > I need to find a way to map a set of numbers up to 4 (e.g. 1,2,3,4 or 1,2) > to any number in a range of up to 10,000 (ideally, unlimited). Such that, > > (e.g. 1

Re: [PHP] PHP Math Question

2003-12-11 Thread Evan Nemerson
On Thursday 11 December 2003 03:33 pm, Mike D wrote: > I'm am completely stumped on a seemingly simple math formula > > I need to find a way to map a set of numbers up to 4 (e.g. 1,2,3,4 or 1,2) > to any number in a range of up to 10,000 (ideally, unlimited). Such that, > > (e.g. 1,2,3,4) > > 1 is

[PHP] PHP Math Question

2003-12-11 Thread Mike D
I'm am completely stumped on a seemingly simple math formula I need to find a way to map a set of numbers up to 4 (e.g. 1,2,3,4 or 1,2) to any number in a range of up to 10,000 (ideally, unlimited). Such that, (e.g. 1,2,3,4) 1 is to 1 2 is to 2 3 is to 3 4 is to 4 5 is to 1 6 is to 2 7 is to 3

Re: [PHP] math question

2001-06-23 Thread George Alexander
If u don't want to use the pi() function. Try M_PI. This is a pi constant its value is 3.14159265358979323846 $theta=15*M_PI/360; - Original Message - From: Anon Y Mous <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, June 23, 2001 2:21 PM Subject: Re: [P

Re: [PHP] math question

2001-06-23 Thread Zak Greant
k - Original Message - From: "Julia A. Case" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, June 23, 2001 12:07 AM Subject: [PHP] math question > $theta = 15*pi/360; > gives a value of 0 for $theta... it should be something like 0.131... -- PHP Gene

Re: [PHP] math question

2001-06-23 Thread Anon Y Mous
pi is a function. Try this: $theta = 15*pi()/360; It should return 0.13089969389957 -Evan Nemerson > $theta = 15*pi/360; > gives a value of 0 for $theta... it should be something like 0.131... > Julia -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTE

Re: [PHP] math question

2001-06-23 Thread Hugh Bothwell
""Julia A. Case"" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > $theta = 15*pi/360; > gives a value of 0 for $theta... it should be something like 0.131... > > Julia I get echo 15 * M_PI / 360; returns 0.13089969389957 -- PHP General Mailing Li

[PHP] math question

2001-06-23 Thread Julia A. Case
$theta = 15*pi/360; gives a value of 0 for $theta... it should be something like 0.131... Julia -- [ Julia Anne Case ] [Ships are safe inside the harbor, ] [Programmer at large] [ but is that what ships are really for.] [ Admining Linux ] [ To thine own