Re: [PHP] Math Question....

2010-04-23 Thread Richard Quadling
On 22 April 2010 17:47, Developer Team d...@thebat.net wrote: Awesome source. Thanks On 4/22/10, Richard Quadling rquadl...@googlemail.com wrote: On 22 April 2010 14:48, Dan Joseph dmjos...@gmail.com wrote: On Thu, Apr 22, 2010 at 10:29 AM, Richard Quadling rquadl...@googlemail.com wrote:

Re: [PHP] Math Question....

2010-04-23 Thread Dotan Cohen
On 22 April 2010 17:07, Dan Joseph dmjos...@gmail.com 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

Re: [PHP] Math Question....

2010-04-23 Thread Richard Quadling
On 23 April 2010 13:33, Dotan Cohen dotanco...@gmail.com 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 :

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 stephe...@rogers.com 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

Re: [PHP] Math Question....

2010-04-23 Thread Richard Quadling
?php function findBestFactors($Value, $GroupSize = INF) { foreach(range(min($GroupSize, ceil(sqrt($Value))), 1) as $Factor) { if (0 == ($Value % $Factor)) { return array($Factor, $Value / $Factor);

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 --

Re: [PHP] Math Question....

2010-04-22 Thread Dan Joseph
On Thu, Apr 22, 2010 at 10:12 AM, Stephen stephe...@rogers.com 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,

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 stephe...@rogers.com 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

Re: [PHP] Math Question....

2010-04-22 Thread Richard Quadling
On 22 April 2010 15:13, Ashley Sheridan a...@ashleysheridan.co.uk wrote: On Thu, 2010-04-22 at 10:17 -0400, Dan Joseph wrote: On Thu, Apr 22, 2010 at 10:12 AM, Stephen stephe...@rogers.com wrote: 1,252,398 DIV 30 = 41,746 groups of 30. 1,252,398 MOD 30 = 18 items in last group Well,

Re: [PHP] Math Question....

2010-04-22 Thread Richard Quadling
On 22 April 2010 15:26, Richard Quadling rquadl...@googlemail.com wrote: On 22 April 2010 15:13, Ashley Sheridan a...@ashleysheridan.co.uk wrote: On Thu, 2010-04-22 at 10:17 -0400, Dan Joseph wrote: On Thu, Apr 22, 2010 at 10:12 AM, Stephen stephe...@rogers.com wrote: 1,252,398 DIV 30 =

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 stephe

Re: [PHP] Math Question....

2010-04-22 Thread Dan Joseph
On Thu, Apr 22, 2010 at 10:29 AM, Richard Quadling rquadl...@googlemail.com 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:

Re: [PHP] Math Question....

2010-04-22 Thread Peter van der Does
On Thu, 22 Apr 2010 10:17:10 -0400 Dan Joseph dmjos...@gmail.com wrote: On Thu, Apr 22, 2010 at 10:12 AM, Stephen stephe...@rogers.com 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

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 pvanderd...@gmail.com wrote: My take on it: $Items=1252398; $MaxInGroup=30; for ($x=$MaxInGroup; $x1;$x--) { $remainder=$Items % $x; // Change 17 to the max amount allowed in the last group if ($remainder == 0 ||

Re: [PHP] Math Question....

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

Re: [PHP] Math Question....

2010-04-22 Thread Dan Joseph
On Thu, Apr 22, 2010 at 12:16 PM, Richard Quadling rquadl...@googlemail.com wrote: On 22 April 2010 14:48, Dan Joseph dmjos...@gmail.com wrote: This seems to be working ... ?php function findBestFactors($Value, $GroupSize, array $Factors = null) { $Factors = array();

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

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 Jeremy Schroeder
Thanks for all the help, floor() was the correct choice for this problem . -Blake Vincent Jansen wrote: Hi Richard I agree But you always want to round down ;) Blake Is there a function that when you divide 2 numbers you drop the Blake remainder and are left with the whole number. Still

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

[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,2,3,4)

RE: [PHP] Re: PHP Math Question

2003-12-11 Thread Bronislav Kluka
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: PHP Math Question

Re: [PHP] Re: PHP Math Question

2003-12-11 Thread Website Managers.net
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- | From: Eric Bolikowski [mailto:[EMAIL PROTECTED

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) 1

Re: [PHP] Re: PHP Math Question

2003-12-11 Thread Eric Bolikowski
: Bronislav Kluèka [EMAIL PROTECTED] To: Eric Bolikowski [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

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 List

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

Re: [PHP] math question

2001-06-23 Thread Zak Greant
Have you defined the 'pi' constant? If you are trying to use PHP's built-in PI constant, it is named 'M_PI' Perhaps consider increasing your error reporting level so that PHP reports problems like undefined constants - see error_reporting() for more details. --zak - Original Message -

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: [PHP] math question pi