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
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
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
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
4 matches
Mail list logo