Re: [Rails] ceil method

2012-07-12 Thread Dave Aronson
On Thu, Jul 12, 2012 at 1:13 AM, John Merlino stoici...@aol.com wrote: (@objects.size / 3.0).ceil So if size returns 2, then the above expression returns 1. Here's my question. In terms of arithmetic, I dont understand why 3.0 must be used and not just 3. To clarify (and expand, thus

[Rails] ceil method

2012-07-11 Thread John Merlino
Often times the ceil method is used for patterns that involve grouping. For example, if I have an array of objects and I want to group them in rows of 3, I might do this: (@objects.size / 3.0).ceil So if size returns 2, then the above expression returns 1. Here's my question. In terms of

Re: [Rails] ceil method

2012-07-11 Thread Norbert Melzer
Am 12.07.2012 07:13 schrieb John Merlino stoici...@aol.com: Often times the ceil method is used for patterns that involve grouping. For example, if I have an array of objects and I want to group them in rows of 3, I might do this: (@objects.size / 3.0).ceil So if size returns 2, then the

Re: [Rails] ceil method

2012-07-11 Thread Walter Lee Davis
Let's ask irb: 1.9.2-p320 :002 3/2 = 1 1.9.2-p320 :003 3.0/2 = 1.5 Walter On Jul 12, 2012, at 1:13 AM, John Merlino wrote: Often times the ceil method is used for patterns that involve grouping. For example, if I have an array of objects and I want to group them in rows of 3, I